Unit Testing for startupsExperiences from Loopt
Heine Frifeldt <heine@loopt.com>Server Team Manager
Got Introduced to extreme programming in 2000 @ Adomo DK
Have previously tried to have lots of manual tests
Realized the value of unit tests
Continued Agile Development in Adomo US
Joined Loopt in 2008
Code examples are in C#, but topics should apply regardless of language
Feel free to ask questions2
Loopt – What do we do?3Connecting You with Friends and Family
Loopt – What do we do?4Connecting You with the Places You Go
Loopt – What do we do?5Connecting You with Your Local Businesses
Time for Unit Test in Startup?Turn one-off tests into automated tests
Takes extra time upfront but it’s worth it
Legacy clients likely for mobile companies
Confident deployments
Unit tests work as documentation
Easy way for new employees to get familiarized with code6
OverviewInitial state of Loopt tests
Untestable code
Code structure
Improved code
Lessons learned
Tools7
Initial ExperienceMy first UT experiences we wrote the tests along with code
You structure your code for testability

Loopt unit test experiences

Editor's Notes

  • #13 No constructorStatic method to execute logicMakes connection to DB and invokes stored procReads from binary stream and converts to storecproc arguments
  • #14 Notice ConfigurationManager.GetSection is a static from BCLSome code paths would check “IsProduction” config setting and behave according to environment