D14: undertake unit testing of solutions, with appropriate levels of test code coverage, to identify and, where necessary, resolve issues (Software Development Lifecycle -Implementation and Build phase).

  1. Unit Testing: Unit testing is a type of software testing where individual components or units of a software system are tested. The purpose is to validate that each unit of the software performs as designed. A unit is the smallest testable part of any software and can have one or many inputs and typically has a single output. In procedural programming, a unit may be an individual function or procedure.

    Unit testing is important because it helps discover bugs in the initial phases of the software development lifecycle, which makes it easier and cheaper to fix them later. Developers usually perform these tests, and they use test frameworks to write them.

  2. Test Code Coverage: Code coverage is a measure used in software testing. It describes the degree to which the source code of a program has been tested. The goal is to ensure as much code as possible is covered in testing to catch any bugs or issues that may exist.

    There are different types of code coverage, including statement coverage (every statement in the program has been executed at least once), branch coverage (every branch of each control structure has been executed), function coverage (every function in the program has been executed), and more.

  3. Identifying and Resolving Issues: During unit testing, the developer will run the software with various inputs to ensure it is producing the expected outputs. If an issue is found during these tests, the developer will need to identify the cause of the problem, which could be a mistake in the code, an overlooked use case, etc. Once the issue is identified, the developer is responsible for fixing it, then re-running the tests to ensure the solution is now working correctly.

The Software Development Lifecycle (SDLC) is a systematic process for building software that ensures the quality and correctness of the software built. The SDLC process includes several phases: requirement collection, design, implementation or coding, testing, deployment, and maintenance.

The Implementation and Build phase is where the actual code is written or implemented. Based on the design documents, this phase transforms the software architecture and design into the actual software. The code is built into an executable or deployable form during the build process.

In this phase, the developer also needs to ensure they are not only writing the code to deliver the required functionality but also writing tests to verify the code's correctness. This includes unit tests to test individual functions or components and ensuring appropriate levels of test code coverage. When tests fail, it means there's a discrepancy between the expected and actual output, and the developer needs to resolve these issues by debugging and fixing the code before proceeding to the next phase of the SDLC.

Back