Skip to main content

Test Driven Development (TDD)

Test Driven Development (TDD) is a software development practice that focuses on creating unit test cases before developing the actual code.

It is an iterative approach that combines programming, the creation of unit tests, and refactoring.

This is as opposed to software being developed first and test cases created later.


Rules for TDD:
  1. write a “single” unit test describing an aspect of the program
  2. run the test, which should fail because the program lacks that feature
  3. write “just enough” code, the simplest possible, to make the test pass
  4. “refactor” the code until it conforms to the simplicity criteria
  5. repeat, “accumulating” unit tests over time

Advantages of TDD:

  • You only write code that’s needed
  • More modular design
  • Easier to maintain
  • Easier to refactor
  • High test coverage
  • Tests document the code
  • Less debugging
Disadvantages of TDD:

  • Developer can consider it as a waste of time.
  • The test can be targeted on verification of classes and methods and not on what the code really should do.
  • Test become part of the maintenance overhead of a project.
  • Rewrite the test when requirements change.

Comments

Popular posts from this blog

Scaled Agile Framework (SAFe)

The Scaled Agile Framework (SAFe) is a set of organizational and workflow patterns for implementing agile practices at an enterprise scale. The framework is a body of knowledge that includes structured guidance on roles and responsibilities, how to plan and manage the work, and values to uphold. Scrum is a simple, flexible approach to adopting Agile that's great for small teams. SAFe is an enterprise-wide Agile framework designed to help bring Agile beyond the team and into the company as a whole. Scaled Agile has built a comprehensive level that includes all the four layers called the team, program, large solutions, and portfolio level. 4 Layers: Portfolio - Strategy, Vision, Roadmap, Strategy goal, Decision making, Budget, Portfolio level metrics,  Program - Align multiple teams towards a common mission, Bring together all the Agile teams, transparency, collaboration, and synchronisation, Scrum of Scrums, Product Owners to define the overall vision. Large Solutions - ar...

Risk Register

A project risk register is a tool project managers use to track and monitor any risks that might impact their projects. Risk management is a vital component of project management because it's how you proactively combat potential problems or setbacks. Risk Description Impact Risk Response Risk Level Risk Owner Automation Testing Software licence delay Delay in starting testing and project schedule impact As we have one licence. Planned to start automation testing in 2 shifts. Planned to get one more licence in 2 weeks’ time. High IT team Frequent Disruption in dependency API services Delay in development of integration and unit testing Dependency API service is down, and the team is working on resolving the issue. Continuously working with API team High External Team/ Project Manager There is chance of new requir...

Lessons learned in Project Management

Lessons learned in Project Management Lessons learned (it may be +ve or -ve) in project management are the knowledge gained during a project that can be used to improve future performance. Lessons learned are documented with solutions to provide future project teams with information that can increase effectiveness and efficiency. Every project manager should be well aware of the impact lessons learned can have on the current and future projects. However, despite knowing the value of lessons learned, not everyone makes full use of them.  The lessons learnt documented using below process flow: 1) Identify: Identify comments and recommendations for use in future project. This is usually done through a project survey that is sent out to all team members. Various questions connected to a project help the participants share their lessons learned.  2) Document: Document and share the findings 3) Analyze: Analyze the finding and find the solution 4) Store: Store in a repository 5) Ret...