xUnit and TDD: Why and How in Enterprise Software, August 2012

Consultant and Founder at Shaka Code, LLC à ShakaCode
15 Aug 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
1 sur 59

Contenu connexe

Tendances

Test driven development(tdd)Test driven development(tdd)
Test driven development(tdd)Omar Youssef Shiha
A Not-So-Serious Introduction to Test Driven Development (TDD) A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD) CodeOps Technologies LLP
Test drive on driven development processTest drive on driven development process
Test drive on driven development processMuralidharan Deenathayalan
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...agil8 Ltd
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven DevelopmentLim Chanmann
Test driven development and react js application go hand in handTest driven development and react js application go hand in hand
Test driven development and react js application go hand in handKaty Slemon

En vedette

Improving Your Heroku App Performance with Asset CDN and UnicornImproving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and UnicornSimon Bagreev
xUnitxUnit
xUnitMohamed Eldeeb
React on rails v4React on rails v4
React on rails v4Justin Gordon
Slides with notes from Ruby Conf 2014 on using simple techniques to create sl...Slides with notes from Ruby Conf 2014 on using simple techniques to create sl...
Slides with notes from Ruby Conf 2014 on using simple techniques to create sl...Justin Gordon
Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...
Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...Justin Gordon
Double Loop: TDD & BDD Done Right!Double Loop: TDD & BDD Done Right!
Double Loop: TDD & BDD Done Right!Jessica Mauerhan

Similaire à xUnit and TDD: Why and How in Enterprise Software, August 2012

Test-Driven Development In ActionTest-Driven Development In Action
Test-Driven Development In ActionJon Kruger
Cleaner Code Through Test-Driven DevelopmentCleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven DevelopmentAll Things Open
Understanding Unit TestingUnderstanding Unit Testing
Understanding Unit Testingikhwanhayat
TDD - Agile TDD - Agile
TDD - Agile harinderpisces
BDD presentationBDD presentation
BDD presentationtemebele
Test Driven Development - Overview and AdoptionTest Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionPyxis Technologies

Dernier

"Intro to Stateful Services or How to get 1 million RPS from a single node", ..."Intro to Stateful Services or How to get 1 million RPS from a single node", ...
"Intro to Stateful Services or How to get 1 million RPS from a single node", ...Fwdays
Knowledge Graphs and Generative AI_GraphSummit Minneapolis Sept 20.pptxKnowledge Graphs and Generative AI_GraphSummit Minneapolis Sept 20.pptx
Knowledge Graphs and Generative AI_GraphSummit Minneapolis Sept 20.pptxNeo4j
Deep Dive Microsoft Viva Insights - Collabdays Bletchley Park 2023Deep Dive Microsoft Viva Insights - Collabdays Bletchley Park 2023
Deep Dive Microsoft Viva Insights - Collabdays Bletchley Park 2023Chirag Patel
How is AI changing journalism? Strategic considerations for publishers and ne...How is AI changing journalism? Strategic considerations for publishers and ne...
How is AI changing journalism? Strategic considerations for publishers and ne...Damian Radcliffe
10 reasons to choose Galaxy Tab S9 for work on the go10 reasons to choose Galaxy Tab S9 for work on the go
10 reasons to choose Galaxy Tab S9 for work on the goSamsung Business USA
Solving today’s Traffic Problems with Sustainable Ride Hailing SolutionSolving today’s Traffic Problems with Sustainable Ride Hailing Solution
Solving today’s Traffic Problems with Sustainable Ride Hailing SolutionOn Demand Clone

Dernier(20)

xUnit and TDD: Why and How in Enterprise Software, August 2012

Notes de l'éditeur

  1. Justin
  2. Wikipedia: http://en.wikipedia.org/wiki/Refactoring In software engineering, the term refactoring means modifying source code without changing its external behavior, and is sometimes informally referred to as "cleaning it up". In extreme programming and other agile methodologies refactoring is an integral part of the software development cycle: developers alternate between adding new tests and functionality and refactoring the code to improve its internal consistency and clarity. Automated unit testing ensures that refactoring does not make the code stop working. Refactoring does not fix bugs or add new functionality. Rather it is designed to improve the understandability of the code or change its structure and design, and remove dead code, to make it easier for human maintenance in the future. In particular, adding new behavior to a program might be difficult with the program's given structure, so a developer might refactor it first to make it easy, and then add the new behavior. An example of a trivial refactoring is to change a variable name into something more meaningful, such as from a single letter 'i' to 'interestRate'. A more complex refactoring is to turn the code within an if block into a subroutine. An even more complex refactoring is to replace an if conditional with polymorphism. While "cleaning up" code has happened for decades, the key insight in refactoring is to intentionally "clean up" code separately from adding new functionality, using a known catalogue of common useful refactoring methods, and then separately testing the code (knowing that any behavioral changes indicate a bug). The new aspect is explicitly wanting to improve an existing design without altering its intent or behavior.
  3. “ Normal” development cycle inhibits JUnit test creation Developers rewarded for getting something “working” ASAP Code like mad to meet a deadline (DCut?); testing is an afterthought Throw it over the fence to QA and fix bugs as they’re found Motivation to write tests for “already-working” code is low! Inertia : hard to change ingrained working habits
  4. Ask about purity of TDD in practice.
  5. Any time you write code that is not fixing a failing test. I.e., Writing code, then writing tests or intending to eventually write tests. No matter how good they are! Relying on QA to automate their manual tests. Especially using SilkTest or similar. Be honest when trying this. If it isn’t TDD, you won’t get the benefits What about the conventional approach of have the architects design the APIs, the developers code to the specs, and QA tests? Is that TDD?
  6. You cannot do TDD without the right tools Emacs or VIM??? These do not support single test running and refactoring,
  7. Note – this slide should be skipped in a short presentation. In a longer presentation, this material will be reviewed several times.
  8. Note – this slide should be skipped in a short presentation.
  9. The setup and teardown boxes are grey to indicate that the reader of the test should be able to focus on the logic of what is done and what is verified (orange boxes)
  10. Production code for end users will hit the DB, so you need to test it! Conventional Wisdom: Real xUnit tests don’t use a DB! But, developers are working on existing codebases that have countless intricate ties to the DB. Common advice is to refactor in order to isolate database dependencies in order to build tests that don’t hit the database, but without tests, how safely can we do the refactoring? Catch 22! Mocks and stubs add (much) more code to maintain (and to fix bugs!). Reliance on mocks and stubs can mask errors with using the DB. Annecdote: GuideWire Software used to depend heavily on stubs and dependency isolation techniques, but now focuses exclusively on tests against the database, using H2 in-memory DB to speed up tests.
  11. This slide tells its story via animation. If you’re reading this slide, then the “blinds” effect means “check” for this object and “pinwheel” means “create the object”
  12. Discuss this slide first with the DOF plumbing and then as if there was no DOF plumbing.
  13. Performance checks if the object with the path was already run, and if so, nothing is done. Then checks if given named object exists in the DB. The name is decoded from the path name. If the name exists, the script is not run.