Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is testing features enough? [closed]

The title says it all, if I test using capybara :

visit this page
expect this content 

and do this for every single feature(e.g signin, signup, search, clicking all the links and buttons, etc), would that be enough? Why would I need to test controllers and models? If features are working as expected, doesn't that mean everything is working in harmony?

like image 872
Ahmad Al-kheat Avatar asked Feb 10 '23 22:02

Ahmad Al-kheat


1 Answers

That technique is called black box testing also know as functional testing. If you are testing as if you are a user of the application it is considered black box. If you are testing it from within it is considered glass box testing.

enter image description here

The question of whether or not is it enough is a matter of personal opinion. My opinion is if it is thorough enough then yes it could be enough.

Some of the advantages of black-box testing include:

  • You have a good chance of writing tests that weren’t imagined by the programmer.

  • The environment the program is running is also tested

  • The invested effort can be used multiple times

Some advantages of glass-box testing include:

  • It forces you to reason carefully about implementation.

  • Spots the Dead Code or other issues with respect to best programming practices.

  • Reveals errors in hidden code.

like image 72
Joel Avatar answered Feb 13 '23 13:02

Joel