Skip to main content
Filter by
Sorted by
Tagged with
Best practices
0 votes
0 replies
49 views

I’m currently working on a personal Android project using Kotlin and Android Studio, following a basic MVVM architecture: ─main │ ├───java │ │ └───com │ │ └───example │ │ └───...
alex_pythooon's user avatar
1 vote
1 answer
117 views

Sometimes when I develop by TDD (Test Driven Development) I need to test the calling order of some class methods. In general I write Python code so I'll show the last test case that I have just ...
User051209's user avatar
  • 2,658
0 votes
2 answers
71 views

I'm encountering a recurring challenge when using TDD to develop code that must perform actions in a specific order. Usually I'm able to write tests such that it is only possible to create a correct ...
Bart's user avatar
  • 1,701
0 votes
1 answer
40 views

I'm currently developing a mobile app for booking overnight accommodations in React Native. I'm currently developing the "book accommodation" functionality and I'm running into a design ...
Ali Kent's user avatar
3 votes
2 answers
9k views

Directory Structure project-root/ ├── src/ │ ├── file1.py │ ├── file2.py └── tests/ │ ├── test_file1.py │ ├── test_file2.py ├── requirements.txt ├── pyproject.toml So basically, under the project ...
Della's user avatar
  • 1,730
1 vote
2 answers
147 views

I'm working on a Ruby on Rails project and practicing Test-Driven Development (TDD) using Minitest. For user authentication (using Devise), I wrote a test to check that a user cannot sign up without ...
obreil54's user avatar
0 votes
1 answer
153 views

So i'm building a FastAPI application whose tests are written in Pytest. Because i have some large models, it is unpracticable for me to define different data manually each time i have to query or do ...
João Pedro Martins de Paula's user avatar
1 vote
2 answers
158 views

In the following code, o[0].AccountEnabled has type bool while graphUsers[0].AccountEnabled has type bool?. Without the explicit cast to bool?, I get the following error: 'bool' does not contain a ...
Shuzheng's user avatar
  • 14.6k
1 vote
1 answer
578 views

I'm learning TDD in simple Nuxt.js project. This project is frontend of Laravel API. And what this project does is to implement all Laravel Fortify options. So I'm using external package called nuxt-...
dust_bg's user avatar
  • 749
-1 votes
3 answers
204 views

I'm trying to make a class that generates a Fibonacci sequence. My two modules are below, the fibonacci.py module and the test_fibonacci.py module. The first two tests pass but the third one seems to ...
JSO's user avatar
  • 21
0 votes
0 answers
58 views

So I have an integration test /tests/my_test.rs and a unit test in /src/some_module/function.rs. If I create a test helper in /tests/test_helper.rs pub struct TestHelper { } impl TestHelper { fn ...
vextorspace's user avatar
0 votes
2 answers
126 views

I'm trying to use TDD to build a search view model that debounces before searching. Until recently I would have created a mock debouncer, injected it into my view model and used that to control the ...
ADB's user avatar
  • 729
0 votes
1 answer
46 views

Am using a simple Karate runner to run my features. But the karate html output is generating my scenario thus. Its adding the [1:1:22] as prefix to the Card is not used scenario name. How can i remove ...
Lester Gray's user avatar
2 votes
1 answer
297 views

Im trying to do a small app with TDD. When i run npm test following error occurs: Error: NG0304: 'mat-form-field' is not a known element (used in the 'SignInComponent' component template): If 'mat-...
edgario's user avatar
  • 29
1 vote
2 answers
89 views

I just solved this puzzle using TDD: https://adventofcode.com/2015/day/6 I started with turnOn function and implemented like this(F#): let turnOn (startx, starty) (endx, endy) (grid: bool[,]) = ...
Mehdi.Valizade's user avatar
1 vote
0 answers
57 views

I have an existing kernel-mode device driver that implements a installable file system (IFS) for Windows. As there are several parts of the driver that should not require operating inside the kernel ...
penguin359's user avatar
  • 1,509
0 votes
1 answer
69 views

Let's say I want to write a function that returns sum of passed positive numbers. Just returns 0 if I don't pass any. And I decide that I want to pass arguments just as a list of arguments and as a ...
KulaGGin's user avatar
  • 1,341
1 vote
2 answers
98 views

I'm writing a Unit Test for a Class (CustomHttpClient) that internally uses a library (java.net.http.HttpClient) to make an external HTTP call. Being it a Unit Test, I would mock the internal ...
javacomelava's user avatar
-1 votes
1 answer
557 views

Here is my situation with testing. There is a note in googletest that EXPECT_CALL’s must be set first before the calls on mock methods (https://google.github.io/googletest/gmock_for_dummies.html#...
PopherTheG's user avatar
1 vote
1 answer
63 views

I'm new to Test Driven Development and I've been thinking about how to test some API wrappers which perform modifications on the received data so it complies with my own custom format. I ran into an ...
CyborgOctopus's user avatar
1 vote
2 answers
463 views

I'm just finishing my first year writing production code in Rails, and I'm not really stuck here, but the non-rubyness of what I'm experiencing is weird, and I wanted to see if anyone had this problem....
Louis Pate's user avatar
2 votes
1 answer
208 views

I am trying to mock the functionality of the EncryptAsync method in Azure.Security.KeyVault.Keys.Cryptography.CryptographyClient. This is the method I am trying to cover in my unit test. public ...
mohanraj's user avatar
1 vote
1 answer
96 views

I am new to Typescript, but with my JAVA Knowledge, I believe exporting functions breaks Encapsulation principles. for example: hello.ts ** Below method will be called from outside *** export const ...
shukla's user avatar
  • 85
0 votes
1 answer
34 views

The system is designed with entities for each of the business elements. Each entity is represented as a class with methods for its behavior and property for its data. We map the entity to the database ...
Daggen's user avatar
  • 61
0 votes
3 answers
673 views

I'm building out a SwiftData model in the preliminary stages of app development. I'm using test-driven development (tdd) to iterate on the model and iron out kinks prior to integrating the model into ...
pkamb's user avatar
  • 35.5k
1 vote
2 answers
176 views

I've been thinking a lot about unit tests today and I got a bit puzzled as to how exactly unit tests are created during the test-driven development (TDD) process. (To be clear, a unit test for me is ...
helloworld123's user avatar
0 votes
1 answer
61 views

I’m working on a side a project while trying to discipline myself to get accustomed to the TDD approach in Django. I'm not sure why I’m running into this failed test (venv) osahenru@osahenru ~/D/q-4&...
osahenru's user avatar
0 votes
0 answers
149 views

How would one mock this call to a ethereum smart contract using the web3 js library. export const getERC20Balance = async ( web3Client: Web3, tokenAddress: string, walletAddress: string ) => {...
Umer's user avatar
  • 1
3 votes
1 answer
494 views

Im trying to thoroughly understand Spring Boot, especially testing. I want all tests to run against the database in application.properties inside src/test/resources regardless of the active profile. ...
theMyth's user avatar
  • 288
3 votes
1 answer
273 views

Given the following test context which makes use of the mockall library, how can I satisfactorily return a reference to cmd that will allow me to make assertions about subsequently chained method ...
pdoherty926's user avatar
  • 10.5k
0 votes
1 answer
71 views

I'm relatively new to writing unit tests. I ran into this scenario while writing unit test cases in .NET 8,for azure functions. Project 1 - ABC.Functions Project 2 - ABC.Functions.Test I have added ...
nandu's user avatar
  • 29
2 votes
2 answers
433 views

I’m currently working on a Java project using Java 17, Dropwizard, and JUnit 5, and I’m focusing on improving my unit tests and adopting Test-Driven Development (TDD) practices. My application ...
Kamil Gajdzinski's user avatar
0 votes
0 answers
91 views

public class MessagePublisher : BackgroundService { private readonly ILogger<MessagePublisher> _logger; private readonly IBusControl _busControl; private readonly IMessageIcd ...
hfl's user avatar
  • 11
0 votes
0 answers
67 views

StandardError Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Active Record release the migration was written for: class AddAttachmentImageToPosts < ...
phskaterock's user avatar
0 votes
1 answer
1k views

I have a simple class that wraps around serializing/deserializing an array of objects and adding them to the session and I want to test it. The errors I've gotten are the there is no session ...
JasonM's user avatar
  • 165
1 vote
1 answer
1k views

I just wondered which unit test framework to use in a .NET MAUI Blazor Hybrid app with multiple targets like Android and Windows. I already tried nUnit and xUnit, but it is not working out of the box. ...
GeKu's user avatar
  • 73
2 votes
0 answers
314 views

I am currently trying to understand the intricacies of CMock's IgnoreAndReturn feature. This is the function under test void USBDriver_Exec(void) { uint8_t Val; // When ...
Iberico's user avatar
  • 182
0 votes
0 answers
427 views

I've been looking for a unit-testing framework for Cerner CCL (now with Oracle), and it looks like one does exist here: https://github.com/cerner/cclunit-framework/blob/main/doc/CCLUNITTESTS.md For ...
Cdn_Dev's user avatar
  • 765
1 vote
3 answers
234 views

Since I started learning and using TDD I was wondering something about the "triangulation technique": why bother writing multiple tests when we could write one that use randomized values? ...
Opack's user avatar
  • 143
1 vote
0 answers
108 views

Is TDD (Test Driven Development) impossible since testing compose requires that the UI to be tested already exists? Or are you creating a FakeScreen and testing it?
yhlee2's user avatar
  • 21
0 votes
1 answer
144 views

This is one weird issue I am facing. All the test cases are passing on the CI/CD but there's a syntax error in one of the files. And when this changes goes to production the server refuses to start. ...
aks's user avatar
  • 9,631
0 votes
0 answers
37 views

I am trying to develop my app using Clean TDD (Test Driven Development) Architecture. For the login feature , I am writing the test case as follows: import 'package:dartz/dartz.dart'; import 'package:...
Allen P Biju's user avatar
1 vote
2 answers
201 views

I'm student at QA and now I try to write a palindrome code in Python based on TDD and unittest. I tried to write the code and it is functional but it doesn't work in according to assertTrue, also I ...
SPGA's user avatar
  • 11
0 votes
2 answers
198 views

Assume you have written a failing test to exploit a bug. You want to push this to upstream and then create a story that is about fixing the code so that the test passes. However, this is prevented by ...
klutt's user avatar
  • 31.7k
1 vote
0 answers
60 views

I just read "Test Driven Development: By Example" by Kent Beck, and I am trying to apply it on my current project. Given an API response I need to extract information from it. API response ...
hardhypochondria's user avatar
0 votes
1 answer
359 views

In Python, we want to assert that a function is called when calling another function. However, we want to ignore the execution after calling the required function. This necessity appears when we don't ...
Mounir's user avatar
  • 17
0 votes
2 answers
115 views

How to verify that my sendMessage method is called with Msg.SAVE or with Msg.UPDATE using mockito's verify method. @Service public class CustomerService { private final CustomerRepository ...
obela06's user avatar
  • 335
-1 votes
3 answers
583 views

I'm writing a specification for a lottery function that should create an array of seven (random) numbers between 1 and 49. The numbers in the array must be unique, a result like [1, 2, 3, 4, 5, 6, 6] ...
spacePirate's user avatar
1 vote
2 answers
100 views

I'm learning about BDD, Behavior-Driven Development, and while I caught the "idea" of having examples of the system's behavior, which we can execute and through which we can develop it, I'm ...
JosePepeDev's user avatar
1 vote
2 answers
155 views

I am currently trying to refactor some of my embedded C code and am trying to apply what James W. Grenning is recommending in his Test-Driven Development for Embedded C book. For this, I am dividing ...
kokopelli's user avatar
  • 372

1
2 3 4 5
124