Introduction This tutorial will illustrate how you can build a REST API backed by PostgreSQL in Go, using Gorilla Mux for routing. The tutorial will employ test-driven development and will conclude by explaining how you can continuously test against a database during development. Goals By the end of this tutorial, you will: Prerequisites This tutorial […]
Category Greatest Hits
How to Test Rails Models with RSpec
Testing is where we spend most of our time as developers. Good testing raises the quality of software, reduces bugs and, in the long run, makes our work easier. In this article, we’ll discuss the basics of testing with Ruby on Rails: What is BDD? How to test models in Rails? How to test business […]
Getting Started with Node.js and Mocha
Mocha is a testing library for Node.js, created to be a simple, extensible, and fast. It’s used for unit and integration testing, and it’s a great candidate for BDD (Behavior Driven Development). This article will walk you through its installation and configuration, as well as demonstrate its usage by implementing a color converter that can […]
Getting Started with RSpec
RSpec is a testing tool for Ruby, created for behavior-driven development (BDD). It is the most frequently used testing library for Ruby in production applications. Even though it has a very rich and powerful DSL (domain-specific language), at its core it is a simple tool which you can start using rather quickly. This RSpec tutorial […]
Stubbing and Mocking in Java with the Spock Testing Framework
Learn how to create true Java unit tests by mocking all external dependencies in your unit tests with the Spock testing framework.
Testing Python Applications with Pytest
Testing applications has become a standard skill set required for any competent developer today. The Python community embraces testing, and even the Python standard library has good inbuilt tools to support testing. In the larger Python ecosystem, there are a lot of testing tools. Pytest stands out among them due to its ease of use […]
Stubbing and Mocking with Mockito and JUnit
Mocking and stubbing are the cornerstones of having quick and simple unit tests. Mocks are useful if you have a dependency on an external system, file reading takes too long, the database connection is unreliable, or if you don’t want to send an email after every test. Unlike with integration or functional tests, where the […]