Thursday 25 October 2018

testing - Unit tests vs Functional tests



What is the difference between unit tests and functional tests? Can a unit test also test a function?


Answer



Unit Test - testing an individual unit, such as a method (function) in a class, with all dependencies mocked up.



Functional Test - AKA Integration Test, testing a slice of functionality in a system. This will test many methods and may interact with dependencies like Databases or Web Services.


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...