-2

If a system is developed using Angular for front-end and java for back-end. Front and back ends are interacting using API's.
My questions are: (Please answer using relevant number before the answer)
1)What should be tested more, back-end or front-end?
2)If I do API testing how should I do it? (I'm not asking for codes. Just steps to follow on)
3)Should I create separate test cases for back-end and front end?

Please note that, both front-end and back-end do validations too and I'm using test automation.

closed as too broad by Alexey R., Bharat Mane, Peter M., NarendraC, demouser123 Apr 15 '18 at 18:13

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • This question seems both too broad and opinion based. – Alexey R. Apr 12 '18 at 10:21
  • Your question is way too broad. Please search archive, we had several questions about test pyramid (comparing testing UI vs API vs backend) like this one (and linked/related) to answering your (1). (2) is 100% off topic (learn more and come back with concrete problems), (3) is: yes, obviously: test pyramid again. – Peter M. Apr 12 '18 at 12:40
2

1)What should be tested more, back-end or front-end?

Every area is important and should be tested as much as possible. Start with the important test cases and continue to build up. Your application may break in the area that is less tested.

2)If I do API testing how should I do it? (I'm not asking for codes. Just steps to follow on)

There are two main options:

GUI based API testing:

Tools created specially for API testing. You can create test suites, test cases, assertions etc. Everything you need for an API test suite.

Pros:

  • You can jump right into writing tests from the beginning
  • Easier to learn
  • Basic programming skills

Cons:

  • Harder to refactor and to maintain, especially for bigger changes in the project
  • Review process is hard since there is no version control system

Code based API testing

Here, you build your own testing framework depending on your project needs. You basically need to choose a language(Java, Python, Groovy) and a HTTP request library

Pros:

  • Test suites are easier to maintain and to extend
  • Easier to refactor
  • Code review

Cons:

  • Spending some time at the beginning with building the framework before adding tests
  • Intermediate/Advanced programming skills required

3)Should I create separate test cases for back-end and front end?

Yes, you need different test cases and test suites for front-end and back-end, because are two different components with different functionalities.

1

1) What should be tested more, back-end or front-end?

To give a simple answer, according to the testing pyramid, more focus should be put on backend tests than UI tests because the UI is more fragile and also changes frequently. One little change in a visual layer on which automated tests depend can break many tests. Maintenance of UI tests is expensive. But of course front-end can and should be also automated but with focus rather than on end-to-end user journeys than low level tests.

2) If I do API testing how should I do it?

I would suggest to get familiarized with BDD testing frameworks like Cucumber and API testing frameworks like REST-assured. And also a tutorial to read I can recommend: https://www.guru99.com/api-testing.html

3) Should I create separate test cases for back-end and front end?

Well, it depends. Some of them can overlap or also be exactly the same but I think that if you will choose a BDD framework and work with Gherkin scenarios you will be able to reuse the same scenarios because they are written on an abstraction level without getting into details of how the request is actually sent.

Not the answer you're looking for? Browse other questions tagged or ask your own question.