1 / 6

TDD patterns and *DD

TDD patterns and *DD. General Patterns. Isolated Test Should the running of the tests affect one another ? Test List What should you test ? Test First When should you write your tests ? Assert First When should you write your assert ? Test Data

faxon
Download Presentation

TDD patterns and *DD

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. TDD patternsand *DD

  2. General Patterns • IsolatedTest • Should the running of the testsaffectoneanother? • TestList • Whatshouldyoutest? • TestFirst • Whenshouldyouwriteyourtests? • AssertFirst • Whenshouldyouwriteyourassert? • Test Data • What data shouldyouuse in yourtest? • Evident Data • How to representintent?

  3. Green Bar Patterns • Fakeit • How to implement a brokentest? • Triangulation • How to abstractfromtests? • Obviousimplementation • How to implementsimpleoperations? • One-to-many • How to implementoperations on collections?

  4. Red Bar Patterns • One steptest • Whichtest to picknext? • Startertest • Whichtest to start with? • Explanationtest • How doyouexplain the behaviour of yourcode? • Learning Test • When to test for external software? • AnotherTest • How to keepfocused? • Break • What to dowhentired? • DoOver • What to dowhenlost?

  5. Other *DD techniques • AcceptanceTest-drivendevelopment (ATDD) • Developmentdrivenbytestsfrom the customer • Set of Black-boxtests • Represents the featuresexpectedby the customer • Reqs AcceptanceTests  Implementation • BehviourTest-drivendevelopment (BDD) • Fromlow to highlevelrequirements • Focus on business values • Use of userstory-liketemplates • (Semi) automatictoolstransformthem into tests

  6. Exercise Minesweeper is a cute little game. The goal of the game is to find all the mines within an NxMfield. To help you, the game shows a number in a square which tells you how many mines there are adjacent to that square. For instance, take the following 4x4 field with 2 mines (which are represented by an * character): *... .... .*.. .... The same field, including the hint numbers described above, would look like this: *100 2210 1*10 1110 You should write a program that takes a field of NxM (0 < N,M <= 100) for input. Each safe square is represented by an "." character (without the quotes) and each mine square is represented by an "*" character (also without the quotes). You can decide how many mines (<NxM) there will be and where they will be in the field. The programshould output N lines of M characterswhere the ”.” is replacedby the number of adiacentmiles to that square. • To beimplementedusingTest-drivendevelopment

More Related