Questions tagged [unit-testing]

Unit testing is a method by which individual units of source code are tested to determine if they are fit for use.

36 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9
votes
2answers
449 views

Boundaries of unit testing between my code and a library or sub-component

Background: I am new to testing in general, and have been studying it in context of JavaScript, specifically React.js, front-end development (actually new to this as well). For the question, I have ...
4
votes
1answer
3k views

Should I mock ObjectMapper in my unit tests?

I have different services in a spring application that have a dependency on Jackson ObjectMapper, the unit tests rely on @InjectMocks to inject all the various dependencies to the class that is under ...
3
votes
0answers
35 views

Decoupling redux reducer tests from state shape

Recently I have been refactoring state shape in a fairly large redux application, and I have found that one of the obstacles to doing to is that the tests for my reducers clearly have a lot of "...
2
votes
0answers
1k views

Unit testing C++ in XCode

I'm working on a plugin for some drafting software. The plugin takes the form of a dynamically loaded mach-o bundle. The software vendor provides a template plugin in the form of an XCode project. ...
1
vote
0answers
63 views

Integration Testing Stripe Payments - stripe-mock or Stripe's test mode?

I'm building an automated test suite to integration/feature test my organization's Stripe implementation within a GitLab CI pipeline. We're running Laravel 8 and using phpunit for testing. Within this ...
1
vote
0answers
156 views

How to run the Unit Test on Master branch using hook before merging the incoming changes of other branches

We have project which have more than 500 unit test and run for hours through Jenkins CI pipeline. In case there is failure of single UNIT test we need to kick off the build job again. I want to run ...
1
vote
0answers
40 views

Integrating Testing with Model Checking

So with Model Checking you have a specification and the model checker automatically goes through your program's states and checks if it matches the specification. What I don't understand is where ...
1
vote
0answers
52 views

Node JS Tape Unit Testing : All cases inside one function for a method

I am using tape for unit testing in Node JS. I wanted to ask one thing about better coding while writing unit testing. When using different inputs to a single method, is it a better idea to use all ...
1
vote
0answers
102 views

writing unit tests for 3rd party applications

Does anyone have any comments on how to write unit tests for 3rd party applications like kamailio...that allow you to write "configuration scripts"? https://www.kamailio.org/wiki/cookbooks/4.0.x/core/...
1
vote
0answers
765 views

Integration test with seed data or programmatically generated objects?

We're having a bit of a discussion in the office about how to implement good integration tests. Example: Account Creation 1. Create User 2. Add Role One case we test is, if there is already a user ...
1
vote
0answers
163 views

How to get verification that you've implemented all your API in a static library?

I just learned that static library building skips the linking stage, which explains why my build process succeeds all the time when it's possible I actually haven't implemented a function in my header....
1
vote
0answers
57 views

Dealing with stubbed external dependency

In sut I should I have two kinds of dependencies to be stubbed: 3rd party dependencies (mongodb & co) and own dependencies: var async = require('async'), // This dependency should not be stubbed ...
1
vote
0answers
715 views

ASP.Net MVC - Implementing a Test Environment

I would like to implement some sort of test environment for ASP.Net projects. I am trying to implement this as an alternative to mocking the entity framework. Here is what I am trying to achieve : ...
1
vote
0answers
7k views

How to verify a method is only called once, with specific arguments (using RhinoMocks)

I'm just starting to use RhinoMocks. Now I'm wondering what test cases I should write. I want to assert that a method is only being called once, with specific arguments. Lets start with my interfaces....
1
vote
0answers
169 views

Unit Tests for Database Abstraction Layer

I previously asked this question about creating an algorithm for joining records from multiple databases, and since then, I have built a rudimentary version of it (which doesn't allow for inter ...
0
votes
0answers
78 views

Idiomatic Golang Unit Testing

Currently I have some code which is structured like this: type Service struct { // some dependencies } func (s *Service) FindStuff(ctx Context) { // this signature cannot be changed // some ...
0
votes
0answers
38 views

Using a bulletin board to support Separation Of Concerns

Context: I'm working on an embedded system with many small functional modules. The business logic within each module is made as simple as possible, but those modules generally need to gather bits of ...
0
votes
2answers
283 views

Entity Framework and Domain Driven Design Testability

I'm using a DDD approach for the Domain classes. Although, I have a problem on my design, that I'm handling it now but didn't have a good idea to over tackle it. My Architecture is the follow one: - ...
0
votes
0answers
44 views

Logically equivalent conditionals, same test, but different condition coverage (google test)

Title pretty much says it. I ran into trouble getting condition coverage of a logical statement and found that the order in which the statement is written (rather than order of operations) results in ...
0
votes
0answers
18 views

Should I do migration testing if the new library needs a different testing suite?

I'm using a pretty old library to make server requests which is not properly tested and it not really matching nowadays requirements, so the plan is to migrate to a new one over the next release. So ...
0
votes
0answers
1k views

Mocking delegate constructors

I am new to Unit Testing in C++. I am supposed to write a Unit test for my code and I am using Google Mock for the same. I have gone through their turtle example. But I am still confused as to how to ...
0
votes
0answers
124 views

Abstract Web API from validation and configuration management in embedded system

Im working with embedded Linux for a router. There is a web GUI for the user to configure router options. When user fill a web form this is submitted to a web server function that is responsible of ...
0
votes
0answers
192 views

How to handle karma/bower in a Symfony Bundle on github?

i am working on a Symfony Bundle that uses angular among other javascript deps. Now i want to unit-test my javascript code and i want to ship those tests as well. My initial idea was to add bower....
0
votes
0answers
125 views

Unit Testing in iOS — Should I split out my Data Model into its own class?

I'm attempting to try out using unit test in for the first time in new iOS activity for work. I love the idea of unit testing, but always find the specifics to be... messy. I get the general ...
-1
votes
1answer
62 views

How to create input data for unit tests for an API client?

I am building the initial set of unit tests for my team's legacy API client system. We have been writing integration tests, but have no unit tests. It's a Sinatra server that accepts requests from our ...
-1
votes
1answer
133 views

How to do test-driven front end development?

I'm trying to rapidly develop my frontend, but every time I change my code I find myself refreshing my browser and running some macro to test whether the changes in my code solved the problem. I ...
-1
votes
1answer
40 views

Non regression test for small set of data data driven from database, how to handle future data

While writing this question I found out that I'm faced with 2 problems: a testing one and a production one but I hope that resolving the situation can solve both issues. Now the question: I have a ...
-1
votes
1answer
73 views

How to test and what kinds of test to write for Request Handlers that use Repository layer?

Consider class below: class FillTestBySerialHandler { /** * * @var FillTestBySerialRepository */ private $fillTestBySerialRepository; function __construct(...
-1
votes
2answers
73 views

How to test functionality that only creates input to a large middle-ware dependency

I am a new lead developer that has recently started at a new company, I have been assigned to a project that is trying to consolidate functionality from lots of different applications already in ...
-1
votes
1answer
84 views

writing a database-centric function with test-first

I'm trying to think about the best method to write a function whose primary operation is going to be doing crud on the database. Here's what the overall structure of the function (sans any ...
-1
votes
1answer
2k views

Test Cases in an Interview Setting

In the first cracking the coding interview video Ms. McDowell talks about candidates that begin by writing test cases in whiteboard interviews. How would one go about this? For example, the ...
-1
votes
1answer
41 views

Testing Application Helper that Depends on Controller

I am working on practicing TDD/BDD/ATDD and I am working on a rails application. I created a helper method that depends conditionally on the type of controller being tested. module ApplicationHelper ...
-3
votes
1answer
54 views

Testable pattern for bytecode interpreter

I am developing virtual machine for prototype-oriented language. And i found one problem. I dont know how to write interpreter that can be tested using unit tests - naive implementation of interpret ...
-3
votes
1answer
80 views

REST API Testing best strategy

I'm currently developing a personal project using Django REST + React and as it grows more complex, I want to add unit testing to ensure that changes don't affect previous functionality. However, I'm ...
-3
votes
5answers
1k views

How to make a test process for unit testing?

I recently joined a team of developers that has been working on a software project for several years. I have been asked to create a unit testing test process to improve their output and suggest new ...
-4
votes
1answer
1k views

What are the benefits of using Jasmine Framework on existing applications?

I got one project which contains JavaScript code. No unit tests were written for JavaScript code. So it is feasible or beneficial to write unit test cases using Jasmine Framework for code? What are ...