Are there any good online tutorials to TDD for an experienced programmer who is new to testing? [closed]

不羁的心 提交于 2019-12-02 17:21:59
Samuel Carrijo

One suggestion I'd make is to start a coding Dojo group. It helps to start TDD from scratch with a group, with most of recommended best-practices and focus on TDD.

Its basic ideas is to take a simple challenge (like a program that transforms roman algarisms strings into ints), and start to code it, starting from simple inputs, and coding only when there's a test failing. It's not the focus of this to end the problem, but to start making it the right way.

Here's another link about it, from which I retrieved the following part:

  • There is a coding challenge that is announced beforehand.
  • There is a room with one computer attached to video screen.
  • The presenter explains the coding challenge and starts the coding. The presenter may or may not choose to have a co-pilot. If this is a Randori session, a co-pilot is usually assigned so that when the switch occurs, the co-pilot takes over for the coder.
  • One half of the pair is changed every 5 minutes if the session is Randori.
  • The coder should continuously explain what she or he is doing.
  • The coder should stop when someone from the audience falls off the sled (has a question about understanding what the pair is doing) -- and only continue when that someone is back on track again.
  • All coders use TDD (Test-Driven Development).
  • All produced code will be made publicly available using the Eclipse Common Public License.
  • The programming language to be used is announced in advance per session.
Alex Martelli

Kent Beck's book gives some examples in Java and some in Python (to be honest, Kent doesn't strike me as a superstar in either language, judging from the example code in this book... but he definitely comes across as a superstar in TDD &c -- as well he should, given he's basically invented it as well as extreme programming, see his wikipedia entry).

I was very pleased with the two-part article "Test Driven Development in Python" on O'Reilly's site:

http://www.onlamp.com/pub/a/python/2004/12/02/tdd_pyunit.html

http://www.onlamp.com/pub/a/python/2005/02/03/tdd_pyunit2.html

These really cleared up how to use Python's unittest module for TDD, as well as giving me a good dose of the TDD mindset.

DrBloodmoney

I think that the chapters covering testing in Dive Into Python are pretty good. They cover building a basic program from scratch using TDD.

Getting Started with Tdd in Java using Eclipse by Brett L. Schuchert

Is a set of screencasts about TDD in Java and in C#. It is starting from the scratch and teaching basics.

I started unit testing a handful of years ago, and I've read quite a few on it since my initial book. However, my initial was "Test Driven" by Lasse. For me, the author made it simple to understand. Perhaps you could pull some info from it for your teaching.

And btw, I've taught TDD as well. I have found that ensuring the audience understands how to use unit tests before going into TDD to be quite handy.

Good luck! :-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!