Skip to main content

Testing

12th October, 2022

Updated: 12th October, 2022

Unit Testing - In computer programming, unit testing is a software testing method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine whether they are fit for use. Intuitively, one can view a unit as the smallest testable part of an application.

Wikipedia

Functional Testing - Functional testing is a quality assurance (QA) process and a type of black box testing that bases its test cases on the specifications of the software component under test. Functions are tested by feeding them input and examining the output, and internal program structure is rarely considered (not like in white-box testing). Functional testing usually describes what the system does.

Wikipedia

Integration Testing - Integration testing (sometimes called integration and testing, abbreviated I&T) is the phase in software testing in which individual software modules are combined and tested as a group. It occurs after unit testing and before validation testing. Integration testing takes as its input modules that have been unit tested, groups them in larger aggregates, applies tests defined in an integration test plan to those aggregates, and delivers as its output the integrated system ready for system testing.

Wikipedia

A frequent topic of debate is between TDD and BDD for unit testing. Test-driven development(TDD) is basically the same as behavior-driven development(BDD) but with different terminology and approaches.

The biggest difference is that TDD follows a test-based implementation whereas BDD looks at behavior. This post has a great example explaining that BDD defines situations to help consider user behaviors.

So instead of laying out functions solely with logic, you’re thinking about how a user might send input and how that input might be passed to JavaScript(like unescaped HTML code). The TDD method takes this as raw data whereas the BDD method looks at behaviors first, then data.

(https://designmodo.com/test-javascript-unit/)

/Spy/. Test code that observes calls to functions outside of the code under test. Spies do not interfere with the operation of those external functions; they merely record the invocation and return value.

/Stub/. Test code that stands in for calls to functions outside of the code under test. The stub code doesn’t attempt to replicate the external function; it simply prevents unresolved errors when the code under test accesses the external function.

/Mock/. Test code that mimics functions or services outside of the code under test. With mocks, test code can specify the return values from those functions or services so it can verify the code’s response.

Mocha - the fun, simple, flexible JavaScript test framework

Chai

Jasmine: Behavior-Driven JavaScript

Sinon.JS - Documentation

Karma - Spectacular Test Runner for Javascript

GitHub - nelsonic/practical-js-tdd: THE Book on Full-Stack JS Web App TDD [Test Driven Development]

webdriver - Protractor, Cucumber and chai as promised: When chai assertion fails - Stack Overflow

Galen Framework | Automated testing of responsive design

BBC-News/wraith: Wraith — A responsive screenshot comparison tool


041e4380-bea0-4ef5-888e-7e5867a28914

Created on: 12th October, 2022

Last updated: 12th October, 2022