Audience
DevOps teams looking for a Unit Testing solution
About MockK
Mocking is a technique to make testing code readable and maintainable. In three consequent articles, I would like to show the basics, features, and quirks of the MockK library. It is a new open-source library (github repository) focused on making mocking in Kotlin great. Injection first tries to match properties by name, then by class or superclass. Check the lookupType parameter for customization. Properties are injected even if private is applied. Constructors for injection are selected from the biggest number of arguments to lowest.
Other Popular Alternatives & Related Software
Cypress
Fast, easy and reliable end-to-end testing for anything that runs in a browser. Cypress has been made specifically for developers and QA engineers, to help them get more done. Cypress benefits from our amazing open-source community - and our tools are evolving better and faster than if we worked on them alone. Cypress is based on a completely new architecture. No more Selenium. Lots more power. Cypress takes snapshots as your tests run. Simply hover over commands in the Command Log to see exactly what happened at each step. Stop guessing why your tests are failing. Debug directly from familiar tools like Chrome DevTools. Our readable errors and stack traces make debugging lightning fast. Cypress automatically reloads whenever you make changes to your tests. See commands execute in real-time in your app. Never add waits or sleeps to your tests. Cypress automatically waits for commands and assertions before moving on. No more async hell.
Learn more
Mockito
Mockito is a mocking framework that tastes really good. It lets you write beautiful tests with a clean & simple API. Mockito doesn’t give you hangover because the tests are very readable and they produce clean verification errors. Read more about features & motivations. Top 10 Java library across all libraries, not only the testing tools. In late 2013 there was an analysis made of 30.000 GitHub projects. Although Mockito reached number 9 in the main report, mockito-core and mockito-all are the same tool and therefore the factual position of Mockito is number 4, surpassing famous tools like Guava or Spring. Treat this study as an indicator of a big impact that Mockito makes every day on unit tests written in Java.
Learn more
Karate
Karate is the only open-source tool to combine API test automation, mocks, performance-testing and even UI automation into a single, unified framework. The BDD syntax popularized by Cucumber is language-neutral and easy for even non-programmers. Assertions and HTML reports are built-in, and you can run tests in parallel for speed. There’s also a cross-platform stand-alone executable for teams not comfortable with Java. You don’t have to compile code. Just write tests in a simple, readable syntax - carefully designed for HTTP, JSON, GraphQL and XML. And you can mix API and UI test automation within the same test script. It is worth pointing out that JSON is a ‘first-class citizen’ of the syntax such that you can express payload and expected data without having to use double-quotes and without having to enclose JSON field names in quotes. There is no need to ‘escape’ characters like you would have had to in Java or other programming languages.
Learn more
Catch2
Catch2 is mainly a unit testing framework for C++, but it also provides basic micro-benchmarking features and simple BDD macros. Catch2's main advantage is that using it is both simple and natural. Test names do not have to be valid identifiers, assertions look like normal C++ boolean expressions, and sections provide a nice and local way to share set-up and tear-down code in tests. You are on the devel branch, where the v3 version is being developed. v3 brings a bunch of significant changes, the big one being that Catch2 is no longer a single-header library. Catch2 now behaves as a normal library, with multiple headers and separately compiled implementation. Quick and easy to get started. Just download two files, add them to your project and you're away. No external dependencies. As long as you can compile C++14 and have the C++ standard library available. Write test cases as, self-registering, functions (or methods, if you prefer).
Learn more
Pricing
Starting Price:
Free
Free Version:
Free Version available.
Company Information
MockK
mockk.io
Other Useful Business Software
Simple, Secure Domain Registration
Register or renew your domain and pay only what we pay. No markups, hidden fees, or surprise add-ons. Choose from over 400 TLDs (.com, .ai, .dev). Every domain is integrated with Cloudflare's industry-leading DNS, CDN, and free SSL to make your site faster and more secure. Simple, secure, at-cost domain registration.
Product Details
Platforms Supported
Windows
Mac
Linux
Training
Documentation
Support
Online