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

Certified Enterprise Architect Professional (CEAP) - Module 5 - Architecture Frameworks

Architecture Frameworks: An Architecture Framework is a theoretical structure that has the purpose of developing, executing, and maintaining an Enterprise Architecture. Advantages of EA framework: Simplify Breaks down areas of the business process Organise business components and create and identify relationships between business Determine the scope Customization in the existing framework Disadvantages of EA framework: Need to follow process Provides only direction and not information It's based on goal and objective Need creativity and proactive thinking Zachman Framework: The Zachman Framework is a widely used model in Enterprise Architecture (EA) that provides a structured way to classify and organize an organization's information infrastructure by defining different perspectives from various stakeholders, allowing for a holistic view of the enterprise and facilitating alignment between business needs and technology solutions; essentially acting as a template to organize arc...

Delivering a project within budget

 Here are some tips for delivering a project within budget: Set a realistic budget Define the project's scope and necessary resources, and create a budget that's realistic. Cost estimate Segment the project into smaller tasks and milestones to plan how to use resources and provide clarity. Divide the project plan Break down the project into tasks to avoid late deliverables and over-budget projects. Monitor progress Regularly track the project's progress to identify and prevent cost overruns. Use progress reports to compare actual costs to the budget. Anticipate and revise changes Communicate with stakeholders to identify and assess risks, and assign owners to each risk. Consider different scenarios Estimation can be difficult for complex projects with many potential outcomes. Tracking: Tracking time spent on tasks, Tracking expenses per project, and Using project management software. Use Historical Data Your project is likely not the first to try and accomplish a specific o...

Product Manager vs Product Owner

Both the product manager and the product owner work towards a common goal, to build and improve products that create meaningful value for customers and all stakeholders within the company. This usually happens by delivering and optimizing product features. Product Manager Product Owner The product manager discovers what users need, prioritizes what to build next, and rallies the team around a product roadmap. The product owner is responsible for maximizing the value of the product by creating and managing the product backlog. This person creates user stories for the development team and communicates the voice of the customer in the Scrum process.      Product Manager and Product Owner's work on below vacuum. Product manager focus on: Business Strategy Long term Product Vision Long term Product Strategy Product Roadmap Alignment with Product Owner Product owner focus on: Release Plan (Product Backlog ie: ...