Testing Questions Flashcards
What are some advantages/disadvantages to testing your code?
Advantages of unit testing are that it reduces or prevents production bugs, increases developer productivity, encourages modular programming. Disadvantages are that it is time-consuming, can’t be challenging to cover all the code, and won’t catch all bugs.
What tools would you use to test your code’s functionality?
- Jasmine: Jasmine is a behaviour-driven development framework for testing JavaScript code. It doesn’t depend on any other JavaScript frameworks and it doesn’t require a DOM. However, it does have a clean, obvious syntax so that you can easily write tests.
- Karma: Karma is a framework-agnostic test runner for connected browsers. The results of each test against each browser are examined and displayed via the command line to the developer so they can see which browsers and tests passed or failed.
- Selenium: Selenium has a straightforward aim: to automate browsers. It is used primarily for automating web applications for testing purposes, but it can just as easily take care of web-based administrative tasks.
What is the difference between a unit test and a functional/integration test?
Unit testing checks the most basic unit of the application, each module, individually. Integration testing checks two or more modules combined to perform tasks. Functional automation testing tests the behavior of the application when it functions as a whole.
What is the purpose of a code style linting tool?
To identify and correct common code mistakes without having to run your app or write test cases. Linting tools are automated tools that analyze source code to detect potential errors, security vulnerabilities, or coding style issues.
What are some of the testing best practices?
*Testing should show the presence of defects. Every application or product release should be tested by different teams and passed through different phases of testing.
* Early testing.
* Exhaustive testing / Iterative test
* Testing is context-dependent / utilize testing and testing strategies based on requirements.
* Defect clustering / During testing, it often happens that the most errors are related to small modules. There can be multiple reasons behind this. The basic principle of software testing states that 80% of problems are usually found in 20% modules.
* Automate test tes management / for example with JIRA.