switchon@lavalamp.biz
+27(0) 83 419 4851 / +27(0) 21 036 1165
Application & software development
Get A Quote

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact
    software testing
    Software Testing And The Importance Thereof
    Jul 18, 2022
    rules for ux designers
    Rules For UX Designers
    Aug 8, 2022

    What Is Test Driven Development?

    Categories
    • Mobile Application Development
    • Quality Assurance
    • Software Development
    • Testing
    • Web Development
    Tags
    • development
    • programming languages
    • quality assurance
    • testing
    what is test driven development
    what is test driven development

    When it comes to building software, software developers and the business they support want it to go as quickly as they can and at the same time, they want the code to work without any defects or bugs.

    These needs require focus on two things: Speed and Quality.

    People think of quality vs speed as a dichotomy, you can have quality and it will take longer or you can have speed but there will be defects, but you can’t have both. But when it comes to Test Driven Development the quote “The only way to go fast, is to go well.” by Robert Martin is well applied.

    Test-driven development decreases defects, it makes developers go faster and produces better code.

    Before we talk about Test Driven Development let's talk about automated testing.

    Automated testing is about tests that can automatically be repeated.  It is code that verifies other code. The test executes the code that is being tested and then uses an assertion to make sure the code performs as expected. These tests are referred to as the test suite and define what the production code should do. Tests are not shipped with the software they are only used by developers and those involved when building the software, the code that they test though does get shipped to the customer and is called the production code.



    So what is Test Driven Development?


    Test Driven Development (TDD) is a process formed by repetition of a short development cycle. Test Driven Development is referred to as the Red, Green, Refactor cycle. You begin by choosing a small task, the next step is to write a failing test referred to as the Red test. In step three you write the simplest code to make the test pass, this will be the Green test. Step four is refactor, and that completes one run of the TDD cycle. Step five is to repeat the cycle.



    The difference between Test Driven Development and Unit Testing. 


    TDD is a process, it can be used with many categories of test including unit test but also with others like integration test and acceptance test. Unit testing focuses on just one type of test, the unit test, TDD is the approach of writing test. The second thing that distinguishes TDD from unit testing is the order. Test Driven Development as the name implies drives the code, unit test on the other hand is often described as test-last or test-first approach. During a test-last approach the production code is written first and then the tests are added. Test-first approach often involves writing up to several tests upfront and then writing many lines of production code.

    The second distinction of TDD is that it differs from test-last and test-first approaches, because the developer writes one test and then minimal code to make the test pass, thus the test shapes the implementation. Although the difference is subtle it is powerful since it does not matter about what programming language the developer uses or problem domain you operate in. TDD is a skill of thinking about the problem you want to solve before you want to solve it. And if developers take time to get clearer about the precise problem they are facing, they will be better able to solve it.

    Another definition to cover in TDD is code coverage. Code coverage is a measurement, a percentage of production code that is executed by automated tests. For example, if there are 1000 lines of production code and 800 lines executed by tests then 80 percent of the code is the code coverage.

    Measuring code coverage is separate from the way tests are written, therefore code coverage can be used regardless of if whether a test-first/test-after or TDD process are used.

    It is however important to note that all new code has almost a hundred percent code coverage when TDD is used.

    Two key takeaways from Test Driven Development:

    1. TDD increases code quality and makes it much easier to add and test new functionality in the latter stages of development.
    2. TDD impacts productivity in that productivity decreases in the short term but increases in the long term.

    Below are Frameworks for Test Driven Development based on different programming languages:

    1. csUnit and NUnit: Are both open source unit testing frameworks for .NET projects.
    2. PyUnit and DocTest: Popular unit testing frameworks for Python.
    3. JUnit and TestNG: is Java unit testing framework.
    4. Rspec: is a testing framework for Ruby projects.

    Contact us


      Related posts:

      7 design principles for web design7 Design Principles For Web Design what's new in vueWhat’s New In Vue software testingSoftware Testing And The Importance Thereof comparing woocommerce vs squrespace vs shopify vs wixComparing WooCommerce vs Squarespace vs Shopify vs Wix in 2020
      Share
      0
      Franko Reynolds
      Franko Reynolds
      Is a software developer and future cyber security professional.

      Leave a Reply Cancel reply

      Your email address will not be published. Required fields are marked *

      Lava Lamp Lab


      Like technology, a lava lamp constantly changes form, producing new conditions with every passing moment



      lava lamp lab facebook   lava lamp lab twitter   lava lamp lab linkedin   lava lamp lab instgram

      Services


      Application & software development

      Outsourced software development

      Project based resourcing

      Digital marketing & consulting

      Graphic design & consulting

      UI / UX design & consulting

      Contact Us


      +27(0) 83 419 4851

      +27(0) 21 036 1165


      switchon@lavalamp.biz


      Unit 4 Monaco Square,
      14 Church Street,
      Durbanville,
      Cape Town, 7550

      NBConsult Group


      nbconsult
      nbconnect msp
      nbclearning
      river broadband
      designer needed
      © 2023 Lava Lamp Lab (Pty) Ltd | All Rights Reserved | Privacy Policy
      Contact us now

        Application & software development

          Outsourced software development

            Project based resourcing

              Digital marketing & consulting

                Graphic design & consulting

                  UI/UX design & consulting

                    Lease an expert

                      Recruitment services

                        We are using cookies to give you the best experience on our website.

                        You can find out more about which cookies we are using or switch them off in settings.

                        Lava Lamp Lab
                        Powered by  GDPR Cookie Compliance
                        Privacy Overview

                        This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

                        Strictly Necessary Cookies

                        Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

                        If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

                        3rd Party Cookies

                        This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.

                        Keeping this cookie enabled helps us to improve our website.

                        Please enable Strictly Necessary Cookies first so that we can save your preferences!

                        Cookie Policy

                        More information about our Cookie Policy