Reputation: 952
I have some confused question about testing.
We're using Slim
as framework of the system. As I know, Unit Test
is the minimum of testing. For example, to test if the class or method works as expected.
To test another functions of the system, for example, the system provide an API to search products information, this search function designed by the following thoughts:
/search
SearchService
into the controller.SearhService
.search_history
.This is how search API
designs.
And we created a functional test for the Search API
called SearchTest
. This is how we done:
$this->runApp()
method provided by Slim
to sending requests to the API entry.Some questions are confusing:
Upvotes: 0
Views: 127
Reputation: 2139
Automated Testing (and testing in general) is considered a good practice in Software Engineering. However, there exist a lot of hot discussion on what are the boundaries for test methodology and types classification.
In this sense, a practical approach to correctly implement a testing methodology is learning from those who you may consider respectable in your context of software development AND making sure that the practice you adopt plays nice for the goal you are willing to achieve. Try to be consistent on this.
Just as a reference, lets take this definition.
Functional testing refers to activities that verify a specific action or function of the code. These are usually found in the code requirements documentation, although some development methodologies work from use cases or user stories. Functional tests tend to answer the question of "can the user do this" or "does this particular feature work."
Considering this approach, you want your tests to give you confidence that the user is able to execute some function (or feature) provided by your application. It does not matter (here) how that feature is provided, just get into your user's shoes and think "Am I getting what I'm expecting from this action?", the answer to that question should hint you the assertions for your test.
Non-functional testing refers to aspects of the software that may not be related to a specific function or user action, such as scalability or other performance, behavior under certain constraints, or security. Testing will determine the breaking point, the point at which extremes of scalability or performance leads to unstable execution. Non-functional requirements tend to be those that reflect the quality of the product, particularly in the context of the suitability perspective of its users.
If you want to test how a certain function is executed, it's probably a Unit Test what may help you to do those assertions.
But again, remember it's not that of a sharp limit on what your tests should perform out from their name, but just to know what classification would fit best for the type of assertions you are performing (that helps you better structure your tests and give you a clear idea of what are you testing). Try to be consistent and focus on testing what you really need to be confident on.
Upvotes: 1