Tuesday, March 8, 2022

Solving: Question on Automating a Finance Web Application

 

Requirement for Web App Test Automation Framework


I read this question on The Test Tribe's Discord community server.




Here is the copy-paste of the question:

Hi all,

Could I have your expertise on below.

I have a requirement to build a test automation framework for a Web Application. Web application is developed using java and MySQL.

And the domain is related with finance sector. 

Most of the functions in the application is working with scheduling services which the service will triggered automatically. Mainly they wanted to verify the data which are displayed in UI with the database. Which means the data which is created with the scheduling services are added correctly. 

Some of the testing scenarios are as below:

1. For each transaction it will create a ticket and need verify the data which is on the ticket.

2. There are some configurations ( like rules) which will used to create behaviors of the transactions and have to verify the transactions will work according to the rule.

3. Whether the ticket is created for the correct user.

4. There are notification rules as SMS, Email and Letters, and needed to verify whether the correct notification rule is triggered. 

5. Verify if the ticket is automatically closed if outstanding or arrears is fully settled.

For automate this kind of scenarios what is best testing methodology ( tools, BDD vs TDD, framework type) should I use for create the framework and writing the test scripts.

Hope you got the above.

Could you please share your thoughts on this. It will be grateful. 

Thank you.



The Common Large Question


Listen to any Test Engineer who wants to start the automation, more or the same this will be the voice and words.  I was here and at times I will land up here when I have to pick the tooling part.  How I drill through this landscape and accomplish the mission will define who am I.  

This is the strategic part of testing and automation.  If this is firm to support the context, it can bring the values.  Else, I keep adding the costs to myself, the project, and the business.  The execution of the strategy will happen with what we pick; but, did it serve what we expect?

I want to demonstrate and share strategic thinking and apply it to arrive at an approaching and execution plan.  Doing this best to the context, will leave me with minimal costs to handle and survive with.  At least, I believe it so.  Just to make sure you are with me till here, do you hear such a similar question from Test Engineers who want to automate or start the automation practice?  

To me, this is one such common large question that I come across when I listen to testers and me.  I say it large for this reason -- the number of times I hear this question is beyond the count I can keep in my practice.



Interpretation of the Need and Requirement


As I read the requirement written and the follow-up discussion on same in the TTT's Discord space, I learn:
  • The present execution state of automation
    • Looks like no automation is written for this web application
  • What's the product?
    • It is a finance application
      • The web UI is the user interface for this application
    • Is there any other user interface for this application?
      • Not sure
  • What does the product do?
    • As said in the requirement,
      • The majority of business use case and function flow is to do with scheduling service
      • This scheduling happens automatically that is the system takes care of it using the input from the user -- which can be seen as one transaction
      • There are rules which can be called configurations
        • These rules will define how and what the transaction must do
        • Need to validate if the transaction adheres to the set rule
        • Need to validate if the ticket is created to the right user using this rule
        • Need to validate if the notification rule executed is right
          • The different types of notifications available
            • SMS
            • Email
            • Letters
              • Postal letter?
        • Each transaction will create a new ticket
      • Validate if the ticket is closed by the system on outstanding credit or arrears is completely settled
  • Technology and Tech Stack
    • Java and MySQL is used in this web application
    • Could be, 
      • The backend is written in Java
      • The database uses MySQL
    • But the system as this that involves scheduling and notification will have queuing, caching, messaging, and searching operations
      • The tech stack used for this is not mentioned in the requirement
      • Imagine a system that has to initiate the postal letter notification
        • This is something which involves not just software but also the people interaction very much
  • Help Expected from Community
    • As written in  the question posted
      • "For automate this kind of scenarios what is best testing methodology ( tools, BDD vs TDD, framework type) should I use for create the framework and writing the test scripts."



Microservices and Where to Automate


I guess this product should have been built using Microservices.  When I say Microservices, I mean, a small, modular, replaceable, independently developed, and independently deployed software application that is responsible for performing one function within a large system.

The diagram of microservice system

An illustrative representation of Microservices system


When I have to pick the automation in the large system built using Microservices, I will know what is that I want to accomplish from automation?  And, this is one of the primary questions to be answered irrespective of what the system is and how it is built.

Further, this leads me to know and understand:

  1. What data do I need to test and validate?
  2. Where to validate data?
  3. How to validate data?
  4. Which is faster and more efficient when validating the data?
  5. What is the expectation when validating the data?
This does not rule out or hold up any layer of the system.  In fact, this helps to know the importance, priority, and criticality of the layer (seam) where I have to start or have my tests concentrated.

I have missed showing the "data" within the hosting area in the above picture.  With that, I ask where should I test and automate to look for what I want to learn.  When I have this picture of my system in mind and how the microservices interact with the tech instances, it directs me to talk with appropriate team members and get started.


Getting Started to Automate in this System

Reading the problem statement and what is expected, it is nowhere mentioned by the tester -- how to automate on the web UI or API or other tech instances of the product.  But, the tester has mentioned the flows and their outcome which should be covered in the automation.

If I had to start testing and automation, I will do the below and assess:

  • APIs:
    1. I look at how good and deterministic is the APIs in processing the requests
    2. Can I take the response of API to infer the system looks to function as expected
    3. If yes, just this has to be taken by the client interface and display the result?
    4. Can I test the notifications at this layer with help of automation?
    5. Can I test the rules at this layer with help of automation?
    6. Can I test for the configuration here?
    7. Can I test for the ticket creation and its state updates?
  • Web UI:
    1. Do the contract between the web UI and API is obliged or does it have any problem?
    2. Is there any JS feature on web UI that takes and processes data further?
      • If yes, do I need to validate this to understand the correctness degree of the data to decide?
    3. Or, the web UI just accepts the response and display the data?
  • Databases, Queuing, Messaging, and Caching:
    1. Is there a need that I should be testing and automating at this layer to decide on the data displayed?
    2. Should I test here in association with other tech instances or in isolation to know the data?
    3. Is testing of Microservice and its endpoint is sufficient?  Or, should I also include these tech instances in testing together with Microservice?

This will set me on the path now to decide where to start automation so that it assists and speed up my testing.  If the Web UI consumes the data from the endpoint and display, I will begin automation at the API layer.  This is simpler, faster, and can help me to figure out the problems distinctly at web UI and API layer.  

If I started automation at the web UI layer to determine the correctness degree of data, maybe I will have to spend more time to automate in this context.  If I have the freedom to go ahead, I will update the team and stakeholders on why I'm going ahead with this decision.  Or, if I have to present it to stakeholders and then start, I will present the work with data i.e. time, what is covered, and how much along with what is not covered and why.

That said, I'm not saying -- I do not automate at the web UI layer.  I'm saying, where will I start and why.  Making sure one part of the system is deterministic will help to figure out the problems in the other parts of the system.  The question from a fellow test engineer says, a requirement of automation for web application and not automating the application on web layer.

The tools and methodology come with culture and practice followed in the project.  At least the test engineer will have choices on the tools and library side though not at methodology.



No comments:

Post a Comment

Please, do write your comment on the read information. Thank you.