Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Exercise for learning Test-Driven Development with the help of predefined tests
| Date | Stars |
|---|---|
| 2026-07-24 | 405 |
| 2026-07-25 | 405 |
| 2026-07-28 | 405 |
| 2026-07-30 | 405 |
| 2026-08-06 | 405 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
TDD Tetris Tutorial
===================
In this tutorial you will be implementing a Tetris game using [Test-Driven Development](http://en.wikipedia.org/wiki/Test-driven_development) (TDD). Some 30 of the first tests have been provided, so that you just need to write code to pass them. The purpose of working with these pre-written test cases is to get accustomed to the TDD cycle, and to get some ideas on what kind of tests to write. After doing that for some while, it will be easier when it's time to begin writing your own tests towards the end of this tutorial.
> **Update 2021**: There now exists a newer [JavaScript-based successor](https://github.com/luontola/tdd-mooc-tetris) of this tutorial. The course material has also been renewed: <https://tdd.mooc.fi>
For information about Test-Driven Development, here are some links. It is recommendable to read them before doing this tutorial, so that you would know what TDD is about.
General information about TDD:
- <http://www.butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd>
- <http://www.butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata>
- <http://jamesshore.com/Agile-Book/test_driven_development.html>
- <http://www.agiledata.org/essays/tdd.html>
TDD is more about specifying behaviour than about testing:
- <http://dannorth.net/introducing-bdd>
- <http://blog.daveastels.com/files/BDD_Intro.pdf>
- <http://blog.orfjackal.net/2010/02/three-styles-of-naming-tests.html>
Summary:
- <http://agileinaflash.blogspot.com/2009/03/unclebobs-three-rules-of-tdd.html>
- <http://agileinaflash.blogspot.com/2009/02/red-green-refactor.html>
- <http://agileinaflash.blogspot.com/2009/02/first.html>
This tutorial has been used in the [TDD programming technique and designing code](http://www.cs.helsinki.fi/u/luontola/tdd-2009/) course in the University of Helsinki. The [lecture slides](http://www.cs.helsinki.fi/u/luontola/tdd-2009/luennot) and [exercises](http://www.cs.helsinki.fi/u/luontola/tdd-2009/harjoitukset) of that course can also be helpful (the material is in English, but for the rest of the site you can use [Google Translate](http://translate.google.com/)).
The Steps of the Tutorial
-------------------------
Use the tests in the [src/test/java/tetris](https://github.com/luontola/tdd-tetris-tutorial/tree/tutorial/src/test/java/tetris/) directory to write a Tetris game. Implement code to pass the tests, one file and one test at a time, in the same order as they are listed below, starting with `FallingBlocksTest`.
When you first run the tests, you should see the first test (`A_new_board.is_empty`) failing. Fix the code (a one-line change) and run the tests to see it pass. Then uncomment the following test (`A_new_board.has_no_falling_blocks`). When that test passes, uncomment the next one (`When_a_block_is_dropped.the_block_is_falling`) and make it pass, until finally you have written code which passes all tests in that class. Then open the next test class and keep on continuing in the same fashion.
Reference implementations for the steps of this tutorial have been [tagged in its Git repository](https://github.com/luontola/tdd-tetris-tutorial/tags?after=take2%2Fpomodoro1). There are also [Let's Code screencasts](http://www.orfjackal.net/lets-code#tdd-tetris-tutorial) of implementing the [take3 branch](https://github.com/luontola/tdd-tetris-tutorial/tree/take3). Also the [beyond](https://github.com/luontola/tdd-tetris-tutorial/tree/beyond) and [take2](https://github.com/luontola/tdd-tetris-tutorial/tree/take2) branches have reference implementations. It might be helpful to have a look at them *after* you have yourself implemented this tutorial that far or you get stuck with your design.
1. **FallingBlocksTest**
In Tetris, the most important feature is that there are blocks which fall down, so that is the first behaviour which we will specify by writing tests. It is good to start the writing of a program with a very trivial test. In this case, we will first make sure that Excerpt of 11,790 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:f3673095e2d7166c, topic:tutorial, name:tutorial, readme:tutorial