Lesson 09 - Reinforcement Exercise

docx

School

Palm Beach State College *

*We aren’t endorsed by this school

Course

1712

Subject

Computer Science

Date

Apr 3, 2024

Type

docx

Pages

7

Uploaded by CLAUDIAMESA7677

Report
1 Functional Testing Methodologies and Test-Driven Development Claudia Mesa Palm Beach State Collage CNT 4408 1 Information System Security Dwight Elliott January 9th, 2024 1
2 Functional Testing Methodologies and Test-Driven Development Functional testing methodologies play a crucial role in ensuring the reliability and quality of software systems. One such methodology gaining popularity is Test-Driven Development (TDD), which emphasizes writing tests before writing the actual code. Through TDD, developers can design and implement code that meets specific functional requirements while ensuring that all aspects of the codebase are thoroughly tested. TDD involves a cyclical process comprising three primary stages: writing failing tests, writing code to pass those tests, and refactoring the code to improve its design without altering its functionality. This iterative approach ensures that each piece of code is thoroughly tested and meets the desired functional specifications. The tests themselves serve as executable documentation, outlining the expected behavior of the system. Unit testing, a component of TDD, focuses on testing individual units or components of the software in isolation. In the context of C++, unit tests are often written using frameworks like Google Test or Catch2, enabling developers to automate the testing process. These tests verify the correctness of individual functions or classes, providing a granular view of the system's behavior. Additionally, functional testing involves both automatic and manual generation of test inputs. Automatic generation tools, such as property-based testing libraries like QuickCheck, randomly generate test inputs based on predefined properties and constraints. This approach helps in uncovering edge cases and corner scenarios that might not be apparent during manual testing. On the other hand, manual test input generation involves human intervention to create test cases based on domain knowledge and intuition. 2
3 Once the tests are generated, they are executed against the software system to validate its behavior. Automated test execution frameworks streamline this process, allowing developers to run tests frequently and efficiently. Continuous Integration (CI) pipelines further automate the execution of tests, ensuring that any code changes do not introduce regressions or break existing functionality. Following test execution, the analysis of test results is crucial in identifying defects and areas for improvement. Developers inspect the test output to determine whether the observed behavior aligns with the expected outcomes specified in the tests. Any deviations or failures indicate potential issues that require further investigation and resolution. In conclusion, functional testing methodologies, particularly Test-Driven Development, provide a systematic approach to ensuring software quality. By emphasizing automated testing, iterative development, and continuous validation, TDD enables developers to build robust and reliable software systems that meet functional requirements. Through a combination of automatic and manual test input generation, execution, analysis, and validation, TDD promotes a rigorous testing culture essential for delivering high-quality software products. 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
4 Flowchart Start | V Define Test Objectives | V Identify Test Inputs | V Develop Test Cases | V Execute Test Cases | V Compare Actual Results with Expected Results | 4
5 V Report Defects (if any) | V Retest Defects (if necessary) | V Verify Fixes (if any) | V End Let's defend this design: 1. Start/End : These are the starting and ending points of the flowchart, denoting the beginning and completion of the functional testing process. 2. Define Test Objectives : Before starting any testing, it's essential to have clear objectives. This step involves defining what aspects of the software functionality are to be tested. 3. Identify Test Inputs : Functional testing requires inputs to test the functionality. These inputs can be data, user actions, or any other triggers that interact with the system under test. 5
6 4. Develop Test Cases : Test cases are developed based on the identified test inputs and objectives. These test cases outline the steps to be executed during testing and the expected outcomes. 5. Execute Test Cases : Test cases are executed against the system under test. This step involves running the software with the defined inputs and observing its behavior. 6. Compare Actual Results with Expected Results : The results obtained during testing are compared against the expected outcomes defined in the test cases. Any discrepancies indicate potential defects. 7. Report Defects (if any) : If discrepancies are found between actual and expected results, defects are documented. This step involves reporting issues with detailed information to the development team for resolution. 8. Retest Defects (if necessary) : After defects are fixed by the development team, the corresponding test cases are re-executed to ensure the issues have been addressed. 9. Verify Fixes (if any) : Once defects are retested and confirmed as resolved, the fixes are verified to ensure they haven't introduced new issues or affected other functionalities. This flowchart provides a structured approach to functional testing, ensuring that all necessary steps are followed systematically. It promotes efficiency and clarity in the testing process, leading to better software quality. 6
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
7 References Ott, A. (n.d.). Test-driven development and unit testing with examples in C++. Retrieved from https://alexott.net/en/cpp/CppTestingIntro.html 7