Documentation Testcoverage
Documentation Testcoverage
Our project aims to develop a user-friendly platform for testing graph coverages, leveraging
modern technologies such as React.js for the front end, Node.js and Express.js for the back
end, and MongoDB for storing user and graph data. By combining these technologies, we
provide a robust solution for graph testing that offers ease of use and scalability.
Unit Testing
For ensuring the reliability and correctness of our application, we have implemented
comprehensive unit testing using Jest and Babel. These testing frameworks enable us to
thoroughly test both the front-end and back-end components and functions, ensuring that our
application performs as expected under various scenarios.
Front-End Testing
In the front end, we focus our testing efforts on the Forms component, which serves as the
interface for users to input graph data, generate graphs, and save them for future reference.
Our tests cover various functionalities of the Forms component, including:
1. Input Handling: We test the functionality of updating the graph name upon input
change. This ensures that users can accurately label their graphs for easy
identification.
2. Modal Interactions: We test the opening and closing of modal dialogs for entering
edge data and saving graphs. This ensures smooth user interactions and proper
handling of modal states.
3. Graph Generation: We test the generation of graphs based on user input. This
ensures that graphs are accurately generated from the provided edge data, facilitating
further analysis and testing.
4. Test Requirement Display: We test the functionality of displaying test requirements,
such as nodes, edges, and edge pairs. This ensures that users can easily visualize the
requirements for testing coverage.
5. Test Path Generation: We test the generation of test paths, including node coverage
and edge coverage. This ensures that the application accurately identifies and presents
test paths for comprehensive coverage testing.
Back-End Testing
In the back end, we focus on testing the algorithms responsible for node coverage and edge
coverage. Our test cases cover various scenarios and edge cases to ensure the reliability and
accuracy of these algorithms. By thoroughly testing the back-end functionality, we ensure
that our application delivers accurate and actionable insights for graph coverage testing.
Overall, our testing approach ensures that our application meets the highest standards of
quality and reliability, providing users with a dependable platform for testing graph
coverages effectively.
Test Cases: Front End
Login.test.js file
Purpose: The test verifies the login functionality of the `LoginScreen` component by
simulating a user login process. It ensures that users can log in successfully with valid
credentials and that the `onLogin` prop function is called upon successful login. This test
helps confirm that the login process works as expected, allowing users to authenticate and
access protected resources within the application.
expect(axiosMock.post).toHaveBeenCalledWith(
"http://localhost:5000/auth/login",
{
username: "testuser",
password: "password123",
},
{
headers: {
"Content-Type": "application/json",
},
}
);
expect(mockOnLogin).toHaveBeenCalled();
});
Form.test.js file : Unit level testing