Test Driven Development

(Difference between revisions)
Jump to: navigation, search
(adde monopoly example and updated code affine giving us permission)
(research link; oss testing link)
Line 1: Line 1:
 +
 +
 
=== Examples of OSS projects that use TDD ===
 
=== Examples of OSS projects that use TDD ===
 
==== Best examples ====
 
==== Best examples ====
 
* http://junit.org/
 
* http://junit.org/
** Well-known java unit testing framwork written by Kent Beck, inventor or TDD himself
+
** Well-known java unit testing framework written by Kent Beck, inventor or TDD himself
 
** https://github.com/junit-team/junit
 
** https://github.com/junit-team/junit
 
** https://github.com/junit-team/junit/tree/master/src/test
 
** https://github.com/junit-team/junit/tree/master/src/test
Line 61: Line 63:
 
* Unit test vs Acceptance test https://dzone.com/articles/Write-JUnit-Tests-in-Spring-With-Mocked-and-Real-Objects
 
* Unit test vs Acceptance test https://dzone.com/articles/Write-JUnit-Tests-in-Spring-With-Mocked-and-Real-Objects
 
* TDD in a CalPoly course https://users.csc.calpoly.edu/~djanzen/courses/405W10/presentations/TDD.pdf
 
* TDD in a CalPoly course https://users.csc.calpoly.edu/~djanzen/courses/405W10/presentations/TDD.pdf
 +
* Research showing TDD's pro's and con's https://tuhat.halvi.helsinki.fi/portal/files/29553974/2014_01_swqd_author_version.pdf
 +
* Lists all open source testing tools - http://www.opensourcetesting.org/
  
  
Line 68: Line 72:
 
* Idea 2: Create a test harness to make, build, and run unit tests on an existing open source project
 
* Idea 2: Create a test harness to make, build, and run unit tests on an existing open source project
 
** Jim Bowring has done this in the past, though it seems they are lengthy projects vs a shorter activity; Do we want to create a “project”-oriented LA?
 
** Jim Bowring has done this in the past, though it seems they are lengthy projects vs a shorter activity; Do we want to create a “project”-oriented LA?
* Idea 3: Use an existing JUnit exercise / tutorial to teach a simple TDD test first, code after scenario
+
* Idea 3: Use an existing JUnit exercise / tutorial to teach a simple TDD 'test first, code later' scenario
  
 
* Teach the “mental discipline” of testing
 
* Teach the “mental discipline” of testing
Line 76: Line 80:
  
 
* Dave thinks ManageIQ does unit testing
 
* Dave thinks ManageIQ does unit testing
 +
 
* Background reading:
 
* Background reading:
 
** http://www.cs.cofc.edu/~bowring/ - course in testing
 
** http://www.cs.cofc.edu/~bowring/ - course in testing

Revision as of 23:28, 17 February 2016


Contents

Examples of OSS projects that use TDD

Best examples

  • https://github.com/unclebob/fitnesse
    • Written by one of the Agile Manifesto co-authors
    • Very clean code, tests in /test directory
    • Not as well known, but might be easier for students to understand

Weaker examples


TDD "Lessons"

  • https://github.com/orfjackal/tdd-tetris-tutorial
    • Tetris based TDD
    • It gives you test cases, already written, and you code to satisfy the tests
    • License says "You may use and modify this material freely for personal non-commercial use. This material may NOT be used as course material without prior written agreement."


Background reading


Ideas and research

TDD

  • Idea 1: Find a project that already has a testing harness and associated tests; learn it, and add a new unit test
  • Idea 2: Create a test harness to make, build, and run unit tests on an existing open source project
    • Jim Bowring has done this in the past, though it seems they are lengthy projects vs a shorter activity; Do we want to create a “project”-oriented LA?
  • Idea 3: Use an existing JUnit exercise / tutorial to teach a simple TDD 'test first, code later' scenario
  • Teach the “mental discipline” of testing
  • How can we test a Requirement?
    • Ensuring testing starts at user requirement gathering
    • Iterating through tests once code has been written, helps to improve the tests
  • Dave thinks ManageIQ does unit testing
Personal tools
Namespaces
Variants
Actions
Events
Learning Resources
HFOSS Projects
Evaluation
Navigation
Toolbox