Describe the concept = think what are the best practices and trade-off. Give example from past experience. Don’t follow blindly all the best practices, but of course take into consideration. Create own principles, but follow PADI, STAR.
So, the question is about setting up the environment for our application, setting up SUT? OR about test execution (locally, remotely)? I guess it is about first one, right?
There are different approaches, lets discuss some of them, and discuss tradeoffs.
First, we can launch the application locally, and run tests locally. Another option, we can use remote DEV and QA environments where our application lives, and execute tests locally or remotely.
Let’s think about the tradeoffs of each solution.
- Setting up application locally could difficult, your machine could be not enough powerful to launch the app. Moreover, you have to test application locally, and team depends on you, when the tester is not available, other team members don’t know what’s going on.
- Another option is to create all-day running environment. Advantage of this that you have always access to the environment, but disadvantage is that the environment is running if even you don’t need, spend money Use it if team is global and needs access always.
Example: At Reuters, initially before fully setting up test execution on Jenkins (problems at Jenkins were with permissions), we were executing tests locally for a couple of sprints. So, problem was that the team was depending too much on me, for executing release tests and regression tests.
Consider also data population in database. Do you delete the data after every creation, do you have teardown? There is a tradeoff: every DELETE could take a second to be executed, if you want to make your tests faster, just don’t delete. But you can populate the DB a lot, and tests should be written so that, they know that there is a data. To overcome this problem, we can use template while creating data, and clean database on a scheduled basis.
Considerations while setting up test environment:
- Do you have any dependencies on 3rd party systems? That could make the tests flakier, not deterministic. So, then you need to launch hermetic environment.
- Authentication and authorization.
- Databases
Hermetic environment. Create env on your own Deploy FE, BE, DB, services on 1 machine/cluster. Mock 3rd parties. Cons: populate data, create test users. Update 3rd party mocks.
Where will you execute tests? On remote server?
- Think about resources (memory, CPU).
- Can you run tests in parallel?
- Can you distribute test execution?
Before choosing the right framework and tools, of course, we have to understand the testing goals, what kind of testing do we want to perform.
- API, UI, perf, security, mobile, accessibility?
Next, clarify the system requirements:
- API: REST, GraphQL? Microservices?
- Web: What kind of browsers are supported, what kind of devices (laptop, mobile), what kind of screen sized and resolution, what kind of OS?
- Desktop app?
- Mobile? OS, models, OS versions?
Ask lots of other questions
- Will the app have access to internet?
- App features?
- How tests should be executed?
- Where reporting should be sent?
- Where test cases should be tracked?
Consider who will use app, consider team skillset.
Always ask if any custom tools are written.
Select test runner. Think about CI/CD tool. How tests will be integrated there, will they be integrated?