HOW TO BUILD SOFTWARE (MVP)

4. TESTING

Testing your software, also known as "Quality assurance" (QA) is a crucial discipline in software development, ensuring that the developed or installed software performs as expected. Although essential, QA is complex and challenging to master due to the vast number of potential test scenarios that must be considered to guarantee a reliable and high-quality product.

4.1

Manual Testing

4.2

Automated testing

 

4.2 AUTOMATED TESTING

KEY TERMS: automated testing, continuous testing

"It is far better to improve the effectiveness of testing first than to improve the efficiency of poor testing. Automating choas gives faster chaos."

- Mark Fewster

Automated Testing, contrary to manual testing, executes tests automatically without human intervention, integrating these tests into the build-and-release pipeline. It uses scripts and tools to execute tests and is typically integrated into the build-and-release pipeline. This includes various test types such as unit tests, API endpoint tests, and end-user tests. While automation helps to avoid manual testing fatigue and repetitive actions, setting up and maintaining these tests can be complex. Challenges include managing intricate scenarios and data, as well as the risk of deprioritizing test development under tight deadlines, which can lead to technical debt.

measuring automated testing

Key metrics for automated testing include code coverage, which measures how much of the code is tested. While achieving 100% coverage is nearly impossible, a coverage rate of 50%-70% is considered effective. Start by implementing automation frameworks to handle repetitive testing tasks effectively.

Types of testing

There are a few testing stages to help ensure that your software is reliable, user-friendly, and ready for launch and the tasks associated to manual and automated testing.

1. UNIT TESTING

This involves testing individual parts of your software to make sure they function correctly on their own.

Manual Testing

Developers or the people responsible for QA manually check individual components (functions, methods) by executing the code and verifying that each unit behaves as expected. This can be time-consuming and prone to human error since each test must be repeated for different inputs.

Example. A QA engineer manually tests the "add task" feature by entering various inputs and observing the output.

Automated Testing

Automated tools (e.g., JUnit, Mocha) are used to run predefined test cases for each unit of code. These tests run quickly and can be triggered automatically with every code change, providing immediate feedback.

Example. Using Mocha to automatically test that the "add task" feature correctly adds tasks to a list for various input conditions.

2. INTEGRATION TESTING

After unit testing, integration testing checks if different parts of the software work together as intended.

Manual Testing

Testers manually verify that different components of the system interact correctly by running through a series of test cases that simulate these interactions. This requires thorough documentation and multiple iterations to check data flow and function calls.

Example. A tester manually inputs a task into the front-end, verifies it reaches the database, and checks that it's retrieved and displayed properly on the interface.

Automated Testing

Automated tools (e.g., Selenium, Postman) simulate interactions between components, such as making API calls to test communication between the front-end and back-end. These tests can automatically detect inconsistencies in how components work together.

Example. Using Postman to automatically send a request from the front-end to the back-end, then checking the database to confirm that the data is stored and retrieved correctly.

3. System testing

This type of testing evaluates the entire software in an environment that mimics real-world usage. It ensures that everything works together as a whole.

Manual Testing

Those responsible for QA manually test the entire system in an environment that mirrors real-world usage. This might involve executing test cases that cover the entire app flow (e.g., login, add a task, mark it complete). Manual system testing is useful for catching subtle issues that might not be evident in automated tests.

Example. A person responsible for QA tests the entire app manually, logging in, adding a task, checking that it appears in the task list, and verifying data synchronization across the app.

Automated Testing

Automated tools run full-system test cases to simulate user behavior across the entire application, ensuring all parts work together as intended. Automation helps cover a wide range of use cases quickly but may not catch all user interface or usability issues.

Example. Using Selenium to automate end-to-end tests, such as logging in, adding a task, and completing it to verify the full system process.

4. INTEGRATION TESTING

In this final stage, real users test the software to ensure it meets their needs and expectations. This might involve letting a small group of users try the app and provide feedback. Concepts like beta testing and gathering user feedback are key components of UAT.

Manual Testing

Real users manually test the system to see if it meets their needs and expectations. This process typically involves a beta test, where users explore the software and report any issues or feature requests. The feedback is then used to make final adjustments.

Example. A group of users manually test the app in a beta environment, adding tasks, completing them, and providing feedback on usability or missing features.

Automated Testing

Although UAT is typically manual, some parts of the process can be supported by automated tools (e.g., collecting feedback, crash reports, or performance data during beta testing). Automated scripts might also gather specific metrics to evaluate performance.

Example. Automated tools track how users interact with the app during UAT and generate reports on performance or common failure points without requiring manual checks from the development team.

MODERN PRACTICES: CONTINUOUS TESTING

Continuous Testing is an automated testing process integrated into the software development lifecycle, where tests are continuously executed at every stage of development. It ensures that code changes are tested immediately, providing quick feedback on the software's functionality, performance, and security. This approach helps identify issues early, enabling faster resolution and ensuring that the application remains stable throughout development.

In modern DevOps practices, Automated Testing and Continuous Testing is part of the Continuous Integration phase of the CI/CD pipeline, promoting higher quality and reliability in modern software practices. For more details, see the DevOps section.

Need help?
Sequolia helps startups navigate complex decisions with proven blueprints, allowing you to focus on growth and success.

In Summary:

  • Automate Unit Tests. Use tools like JUnit or Mocha to quickly run tests on individual code components with every code change.

  • Automate Integration Tests. Employ tools like Selenium or Postman to test interactions between system components, ensuring smooth data flow.
  • Automate System Testing. Use end-to-end tests with tools like Selenium to verify full system functionality in real-world scenarios.
  • Integrate Testing in CI. Automate tests in the Continuous Integration (CI) pipeline for continuous feedback and improved code quality.
  • Track Performance Metrics. Use automated tools to gather data on code coverage and user interactions, aiming for 50-70% coverage.