top of page
Search

Should you rethink your testing activities?

Okay, if you're describing a scenario where you have:

  • Spring Boot Application: Built with REST APIs.

  • Existing Unit Tests: Covering controllers, repositories, and services.

  • Manual End-to-End Testing: Using Postman to call REST APIs and verifying responses against business requirements.

  • Manual UI Testing: Checking transitions, navigation, and functionality.

  • Focus: On validating the application from a user's perspective, not low-level unit testing.

This sounds like you're performing a combination of:

  • Integration Testing (API): Verifying the interaction between different components through the REST API.

  • End-to-End (E2E) Testing (UI & API): Ensuring the entire application flow works as expected from the user interface down to the database (indirectly through the API).

  • Functional Testing: Validating that the application meets the specified business requirements.

  • User Acceptance Testing (UAT) like activities

Here's a breakdown of how to think about this and some potential improvements:

1. Understanding Your Current Testing:

  • Strengths:

    • You're covering a wide range of testing types (unit, integration, E2E).

    • You're focusing on business requirements, which is crucial.

    • Manual testing is valuable for exploratory testing and finding UI issues.

  • Weaknesses:

    • Manual testing is time-consuming and prone to human error.

    • Manual tests are difficult to repeat consistently.

    • Lack of automated E2E tests can lead to regressions slipping through.

    • Postman testing, while good, could be better if automated in a CI/CD pipeline.

    • Lack of automated UI testing.

2. Potential Improvements:

  • Automate API Testing:

    • Use tools like RestAssured (Java), or Postman's Newman (command-line runner) to automate your Postman tests.

    • Integrate these tests into your CI/CD pipeline to run automatically on every build.

    • Use a testing framework like JUnit or TestNG to structure your API tests.

    • Consider using Spring's MockMvc for testing controller endpoints in a more integrated fashion, but still without a full server startup, if you want a faster integrated test.

  • Automate UI Testing:

    • Use tools like Selenium, Cypress, or Playwright to automate UI tests.

    • Write tests that simulate user interactions, such as clicking buttons, filling forms, and navigating pages.

    • Integrate UI tests into your CI/CD pipeline.

    • Consider using Page Object Model to improve test maintainability.

  • Improve Test Data Management:

    • Create a consistent and reliable way to manage test data.

    • Use database seeding or mocking to ensure that tests have the necessary data.

    • Consider tools like Testcontainers for creating isolated test environments.

  • Focus on Test Coverage:

    • Use code coverage tools to measure the effectiveness of your tests.

    • Identify areas of the application that are not adequately covered by tests.

    • Prioritize testing based on the risk and importance of different features.

  • Implement a Testing Strategy:

    • Document your testing strategy, including the types of tests you perform, the tools you use, and the frequency of testing.

    • Define clear roles and responsibilities for testing.

    • Establish a process for reporting and tracking bugs.

  • Consider Behavior-Driven Development (BDD):

    • Use tools like Cucumber or JBehave to write tests in a human-readable format.

    • This can improve communication between developers, testers, and business stakeholders.

    • This also helps in the creation of living documentation.

  • Performance Testing:

    • Consider adding performance testing to your test strategy. Tools like JMeter or Gatling can simulate high loads on your API and UI.

  • Accessibility Testing:

    • Ensure that your application is accessible to users with disabilities. Tools like axe DevTools can help automate accessibility testing.

Example: Automating Postman Tests with Newman

  1. Export your Postman collection and environment as JSON files.

  2. Install Newman: npm install -g newman

  3. Run the collection from the command line:

    Bash

    newman run your-collection.json -e your-environment.json

  4. Integrate this command into your CI/CD pipeline.

By implementing these improvements, you can create a more robust and efficient testing process, reducing the risk of bugs and ensuring that your application meets the needs of your users.

 
 
 

Recent Posts

See All
What we can learn from cats

That's a fascinating observation, and you've touched upon something quite profound about the apparent inner peace that some animals seem...

 
 
 

Comments


Post: Blog2_Post

Subscribe Form

Thanks for submitting!

©2020 by LearnTeachMaster DevOps. Proudly created with Wix.com

bottom of page