instruction stringlengths 34 36.1k |
|---|
I have read many articles explaining the overview of black- and white-box testing, including this Stack Overflow question: https://stackoverflow.com/questions/7258524/unit-testing-black-box-testing-and-white-box-testing
However I still have some confusion around black-box and white-box testing at a basic level.
In term... |
"Solicited output" means a user issues a command to a GUI and the GUI displays the corresponding output.
In this context, I include Web apps in the term "GUI".
However, often a GUI needs to display unsolicited output.
For example, the SE/SO websites often display an icon indicating the number of new email messages and ... |
Some user actions quite naturally lead to find-or-create situations. For example, user logs into a system by alternative method and find-or-create is called give email. Or, another example, User is created given Buyer's email. But of course, if there already is a user, that action causes find-or-create. Some databases ... |
Suppose I have a private project with 100 commits. I don't add a software license until the 101st commit. If I make the project open source, does that mean all first 100 commits are unbound by the software license in the 101st commit?
Should the project be rebased when a license is added?
|
While going through Decorator Pattern from Wikipedia 1 and reading pattern from Head First Book . One thing that struck me and is missing from both the sources or i may have missed it.
Why exactly do we need a Decorator Interface ?
Is it because we need to put all the Concrete Decorators under categorical umbrella.... |
I've got a project that is sort of a virtual operating system.
In this project, the Kernel class is responsible for creating Process classes. The process class consists of Thread classes and the Thread class will consist of a CPU class. The CPU class is actually a CPU emulator and the Thread is therefore an "emulated" ... |
I am currently working a data science team, and we write small utilities all the time to consolidate data, extract data, etc (an example is go through a folder of excel workbooks, convert all the sheets into csv files, and consolidate those sheets that have the same column headers, adding columns for the source locatio... |
If you run the statement:
System .out.println( (Integer.MIN_VALUE)-(Integer .MAX_VALUE ));
In java it returns 1 as the answer. Is this because Java just considers those values as 32bit integers without considering their sign?
Integer.MIN_VALUE = 10000000000000000000000000000000
Integer.MAX_VALUE = 111111111111111... |
My use case is that I have a real-time broadcast app where users get feed items based on a geolocation, i.e. a user will receive posts that were broadcasted from within a user-defined radius where (s)he currently resides.
As a backend implementation I want to use cqrs. The procedure is as follows:
Broadcasters uplo... |
Following SOLID first principle, the Class should be responsible for only a single part of the functionality provided by the software.
The same, I guess, goes with the Methods design principle. They should handle only a single "thing".
Let me give an example:
Suppose I have some program in which, at the end of some met... |
I want to share with you and know what your opinion/improvements are regarding a solution I was tasked with a technical interview I faced.
The exercise:
You need to create an API which will indicate based on a DNA if a person is male or female. This API must have two endpoints:
POST /genre:
It will receive a ... |
I'm looking for a way to quantify where my team should spend it's time addressing technical debt in our codebase. One idea for this is to measure file churn (edits over time). I got the idea from this video where Michael Feathers talks about escaping the technical debt cycle:
https://youtu.be/7hL6g1aTGvo?t=16m53s
What ... |
I manage co-curricular programs for the school I work at. Until now, they have signed up on a google form on a first-in best-dressed capacity, but there is lots of complaints about how some students get all of their preferences, while some get none.
As there is 1000+ students at this school and over 50 activities, it w... |
I have been reading a bit about code readibility and found conflicting information about the following: some say that flexibility (and-or extensibility) actually increase readability, while some others claim it decreases. Is there any generally accepted opinion about that?
|
We have Customer transaction table with many foreign key relationships.
We only want to see certain columns of the 3 tables joined in a web interface.
Eg just Date, PurchaseAmount, ProductName, and StatusDescription.
I hear repository should not select certain columns, it should select All columns. So we should not ... |
I have been tasked to increase code coverage of an existing Java project.
I noticed that the code coverage tool (EclEmma) has highlighted some methods that are never called from anywhere.
My initial reaction is not to write unit tests for these methods, but to highlight them to my line manager/team and ask why these fu... |
In doctrine (or any ORM in general), the easiest way to execute a delete/update operation is to select such entity, then remove entity or update single attribute in the code, ended by persist the changes to database.
This is the native way to execute delete/update operation in most of the ORM frameworks. It is very han... |
We're building two microservices that use CQRS and Event Sourcing: an Order Service and an Inventory Service. When an order is made, the inventory of that item must be decreased by the amount ordered. An order can also be canceled. In that case, the inventory must be increased again.
So in the Order Service we store an... |
I've got a .NET Core application that takes HTTP requests. I'm a little bored, so I decided to stress-test it using West Wind Web Surge, and putting an example request as the body.
My question is, since the request is exactly the same every time, am I seeing artificially high performance because the application has alr... |
I have some B2B services already exposed to customers who manufacture products and ships to end consumer.
These B2B services are implemented using asp.net web API and is performant enough to handle millions request per day.
Now I need to expose services to end consumer for there product activation and hence it is B2C i... |
I am trying to understand UML abstract syntax seen in the UML Specifications. This example below is hard to understand. For example, I don't understand:
the {subsets ownedElement},
the hybrid composition-association,
the /relatedElement (heading slash),
Is there any tutorial or course that explain these points?
I ha... |
I am trying to model an external system in Java and running in to some issues.
I have a handful of related types that I have mapped together through abstract (and sometimes concrete if it made sense) classes.
In a few cases some of the SubClasses turned out to be only implementing a caller method that just picked an ... |
I was having a discussion with few friends about inheritance and composition and what I learnt from that discussion is that the use of inheritance more or less condemned in industry nowadays and either replaced with composition or copy and paste.
Doing a quick Google search confirms this with many articles with titles ... |
I'm new to eventsourced apps and since the beginning I'm facing an issue that I'm unsure how to resolve.
I work in ecommerce and I always try to convey meaningful events to my aggregates like PriceIncreasedEvent, ProductDeactivatedEvent, OutOfStockEvent etc
But many times I just want to do a simple "CRUD" style with my... |
Say I have a program using Java or C, that will interface with a hardware device and either read streaming data or write it to a database before applying a few complex mathematical equations to this data for analysis.
Where would the equations be applied (ie the data layer, application layer)? Is
this possible in SQL,... |
I am currently learning about compiler construction and language design and I am thinking about what native datatypes I want to support in my language. Now there is a whole lot of languages that make a distinction between integer- and real numbers. However, I remember watching a talk by Douglas Crockford in which he sa... |
We are a recently formed team of 4 developers, some of them new to the company, some of them assembled from other, disbanded teams. I would like to know my team members better, how they "tick", how they want to learn, problem-solve, cooperate, communicate, how we see each other, etc. I would like to do that through som... |
Dependency injection (DI) is a well known and fashionable pattern. Most of engineers know its advantages, like:
Making isolation in unit testing possible/easy
Explicitly defining dependencies of a class
Facilitating good design (single responsibility principle (SRP) for example)
Enabling switching implementations quic... |
I am beginning with unit testing in c#.
Here is my converter:
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
int c = 0;
if (value != null)
{
var path = value.ToString();
for (int x = 0; x < path.Length; x++)
{
if (c == 2) { ... |
I'm new to coding and I don't know how what I'm trying to do is called, and I want to find out so I can do more research and not re-invent the wheel. I looked for things such as data consolidation/combine input but the results are either too vague or if I add the name of a language I get irrelevant libraries (eg javasc... |
I am new with the user story map approach, I started with to compose the stories to be implemented from user perspective, and it seems very promising.
However, I am not sure about the non-functional stories, how to place them within the story map. Especially when are talking from user perspective, that is not aware of ... |
I'm finding it tough to test my client-side code without testing implementation details.
For example, lets say you are testing a login form that displays client-side validation errors and does not submit unless the email and password are present and correctly formatted.
You could write a test independent of classnames,... |
Scenario
We have an application which has a session timeout of 20 minutes. However we have a requirement in which users must be able to access a certain page in the site for 8 hours after the original(20 minute) session was created. The page in question needs to use the session ID of the original session to pull saved ... |
The PHP framework Laravel allows to make an API and a website on the same application. As both of them will communicate with the same database, I was asking myself what is better between consuming my own API for my website and making a DAO proper to the website.
On one hand, consuming my own API would make a single ent... |
Is it, at least theoretically, possible to convert a Java application into native code that can be run by something else written in Java? One example of this could be a Minecraft Spigot server. You can code plugins and stick them in the plugins folder of the Spigot server. The server then runs and then runs the plugins... |
I have seen this question and do not believe this to be a duplicate What software models are appropriate for daily builds and continuous integration? .
I don't fully understand what advantage automatic daily complete builds may have over building on every commit in practice (continuous integration being the term I beli... |
I am developing a web-app, currently the application is being developed in both NodeJs and in ASP Net. We are structuring the application in micro-services. Lets say we have a service that calls some functions in a dll and we have the possibility to choose which dll to call the functions from, but the client wants to m... |
I recently reviewed code that read as follows:
if (!condition) {
do_something();
} else {
do_something_else();
}
In other words, in the if statement we checked that a condition was false, and ran one of two functions depending on its truth value.
I thought this was a confusing style, and recommended that the condi... |
I have Java microservice that exposes multiple APIs. Under each API there are many exceptions could be thrown. The last method that catches them all has big catch block ...
catch(exc1 e1 | exc2 e2 | exc3 e3 ..... | exc10 e10){ ...}
They are all of the same level. Now I thought of combining them all under one exception... |
I'm new to server-side programming and I'm building a small "test" web application in NodeJS. Each time the clients need to view data from the PostgreSQL database, NodeJS will execute a "SELECT" query and will give me the result in JSON (which I then add to a webpage and serve it to them). Instead of executing a "SELEC... |
During a code review, I suggested to my coworker that he had questionable parameters for one of his methods. In particular, the parameters revealed too much about the method's implementation details. My coworker argued that a method's inputs must reveal the method's implementation details, so, where does one draw the... |
I read in the book "Clean Code" from Robert C. Martin (at page 71) that the better way to handle try/catch block is to separate process (the "try" part) from the error handling (the "catch part"). Each part should have a dedicated function
Example from the book, illustrating a better way to handle try/catch :
public vo... |
I am developing an n-layer app.
One of the layer is the BusinessLayer and consumes a set of POCOs defined in the CoreLayer. Also I have a PresentationLayer (WinForms)
CoreLayer
POCOs (classes with properties)
Repository interfaces (use the POCOs as parameters types) For example :
public interfaces ICarRepository
{
IE... |
Sorry, maybe it's a well known design principle, but because I don't know a name for this kind of relation, I was not able to find any existing answer.
So, let's say we have a parent which may have many children, but only one child can have some property active (or set). Think about properties like "selected", "current... |
I asked this question on an IRC channel, sadly I am going around in circles.
I am aiming for a high level overview (but with some technical details if necessary) on how a function such as printf() from stdio.h "talks" to the Windows operating system.
I know a bit about MSVCRT.dll, bits of the Windows API such as how it... |
This may be a stupid question, and it would certainly take one Hell of a lexer, but do any extant programming languages allow you to do something like:
c# (1.2) {
// c# code
}
Perl (5) {
# perl code
c# (2.0) {
// some more c# code
}
}
To utilize multiple languages in individual source files? I... |
My example might be slightly contrived, because I've modified it so that the project isn't recognizable by my employer. I'm a newer developer at a very small company.
We have an object - Posts - that has a number of defined attributes (title, tags, content) and an unknown number of unknown attributes. These attributes ... |
I have the following tables:
Organization.
Articles
Templates
Organization is the parent of both articles and templates.
On the articles index page, I display (by default) all templates for the organization.
Here's my problem. How do I add the ability to customize which templates are shown for each article?
I could ... |
Also, if my argument and parameter are the same value can I just use the same identifier for both? Thanks
|
I am building an intranet web app with ASP.NET. We are using Windows authentication for granting access to different web pages. We grab your Windows login server side, then build web pages accordingly. I have a need for a group of tech users to be able to impersonate business users so that the tech users can see the ... |
Given three classes Apple, Fruit and Seed ;
Apple is a kind of Fruit and it has Seed in it. With the knowledge of Apple Class uses directly or indirectly the properties of Fruit and Seed. Can we say Apple is inherited from Fruit and Seed ?
|
I am project manager and I struggle with gaining the attention of the Reviewer of a pull request when the author has replied to a question from the Reviewer. In other words, the Reviewer initially put the PR in the "waiting for author" status because he had questions. The author has now replied with the answer to those... |
I am working on an application that will support working in multiple tabs at the same time. Currently, when a document is locked by a user, other users won't be able to acces the same document but the same user could, if he wanted, open that same document again in a new tab.
My problem at the moment is, when the user c... |
To be a bit more clear, I'll state that I've spent lots of time with different languages. But until now it's been either it'll use it all the time or it doesn't support it at all.
Now work has me starting on projects that require VB.net and I see it provides it both ways in terms of AND and ANDALSO. The first one doe... |
Below is the context,
Right now i'm developing an android application, which will allow the user to upload the video and image to the server. I want to allow the users(his friends) to download the video/image with a watermark on the video/image. So I would like to know what are the advantages of doing watermark on ser... |
Let's assume that I have an Order object that has a List<OrderItem> , the user goes to page and creates his order, now I should save his selection to the database, I have two data service classes one for each entity, OrderDataService and OrderItemDataService, which is more correct?
1- At presentation level in the Add ... |
So I'm trying a few token based authentication in Laravel, each user have token they can use to access certain database. But there is something I still don't understand from these tutorial. The tutorials seem to only check whether a user have token, if yes then authenticate the profile to do certain api call, but obvio... |
I really hate dealing with DB first, it is honestly the bane of my existence.
How can I convince my manager that, although the work to switch is a lot. It will be worth it.
|
The task
The piece of software I'm writing operates on the following object types:
Agents
Calls
CallQueues
These objects can be linked together, and each of them contains some additional information. For example, a Call contains the caller number, an Agent contains it's name, and so on.
This model should react to ex... |
I'm coding a "small" application using MVP pattern that gets it's data from a SQL database.
I'm not using an ORM out of the box, and for the sake of learning, I'm writing my own simple ORM/DAO type of setup. I'm utilizing some of the ideas from ormlite
With regards to the model layer, Here's where I'm at:
DatabaseObje... |
I recently saw a code base which had a data class Address defined somewhere and then in a different place:
fun Address.toAnschrift() = let { address ->
Anschrift().apply {
// mapping code here...
}
}
I found it confusing to not have this method on address directly. Are there any established patterns or... |
C had Procedural Paradigm, then C++ came with OOPS and success of JAVA make it best suitable Programming Paradigm.
Now, Look at recent trends, Kotlin, Swift these languages are not like JAVA these are providing a flexible way of coding, Neither Procedural nor OOPS, and also these languages are being accepted widely.
I... |
Problem Statement:
I have a class that does some validation and it looks something like this:
func a() {b()}
func b() {c()}
func c() {d()}
func d() {e()}
func e() {return}
This is a simplified view, but the idea is that these function calls are dependents of one another as I am doing some transformations and validatio... |
We have an object-oriented database. So, our persistence is truly object oriented.
The example is the object person and the attribute VIP. We have to store, if a person is a VIP or not. Usecase: Ordinary users of our application aren't allowed to see VIPs.
Now, my co-worker claims, not to store the attribute as prope... |
I am working on an a data collector which could be called an API of some sorts, which is based on .Net Core 2.1 .
It's job is to receive and pull (ask for) data from data collectors(executable, DLL,service), those can be in any language, but in this case let's stick with C++.
Collector (API) has to be platform independ... |
I have a function which returns the availability of a module, where the module is only available if multiple conditions are all met. The code looks like this:
bool isShipAvailable() {
bool isAvailable;
isAvailable = this->areSystemsCalibrated;
isAvailable = isAvailable && this->areEnginesFunctional;
isAvailabl... |
Let's say we have three types of objects:
Agents
Calls
CallsQueues
They all can be linked with each other (1to1, 1toM, MtoM) or have no links, and these links change over time. Calls wait in CallsQueues for a free Agent, each Agent serve one Call at a time, and Agents wait for calls in zero, one or multiple CallQueue... |
I had a few questions around value objects in DDD.
I had a class ReportDefinition (basically a schema for a specific report that users can create) with the following properties (in Java):
UUID id;
UUID ownerId;
UUID organizationId;
ReportDefinitionName name;
ReportTitle reportTitle;
ReportDescription reportDescription;... |
I am using a GPL licensed library which stated clearly that it is OK to link to it in commercial projects without the need to publish your own source code (as an exception to the regular GPL that force you to publish the source along with your product).
Let us call this library with an modified GPL license "Library A".... |
We have a single solution Visual Studio web application with multiple projects.
One of the projects (Services project) has APIs for our App clients (Android/iOS). There's separate project for MVC application that powers our Desktop and Mobile website. There's one project for DTO that has POCO classes for request/res... |
I'm looking for guidance about DRY vs Code coupling.
I do not like to duplicate my code and I also do not like code coupling between unrelated modules. So I refactor duplicate code if I find identically duplicate code a year after the duplication was introduced. However, I have increasingly experienced situations where... |
I'm working on a program developed in different variants: a common basic version and various customizations that not only use different logos and images but also add functionalities.
I'm trying to figure out what can be the best approach to saving the project inside our DVCS GIT (I was thinking of using gitea but I'm o... |
When installing application on client's server at the end of the project, how to give admin's password to client? (On paper, by word?) Client may not be very technical so script generating password could be to hard for him.
And should I keep other/same admin credentials for myself for later support?
|
I have a file on the disk. I want a clear distinction of responsibilities between my reader and parser. The reader reads the file and extracts the content as a string.
This string is input to the parser.
When should I share the content as a String vs InputStream between the two classes?
|
I'm going to describe the situation first and ask questions in the end.
I need to validate a scalar value using the Symfony Validator component. The value is an associative array. Now I have defined the following validation constraints according to the expected structure:
new Constraints\Collection([
'Call'... |
I ran into the situation where I have to decide whether a property belongs to my aggregate or not. My domain logic is the following. A User has a group in his organization ex: IT, SALES, MARKETING. Depending on which group this user belongs to, he will have a set of Permissions. The logic of which group has which permi... |
I am reading Vaughn Vernon's series of articles about effective aggregate design.
On the subject of deciding between transactional vs eventual consistency, it states the following:
Discussing this with Eric Evans revealed a very simple and
sound guideline. When examining the use case (or story),
ask whether it's t... |
Do we get efficiency in terms of load handling when the same container (in this case the container has a apache server and a php application) is deployed 5 or more times (i.e. 5 or more containers are deployed) on the same Host or VM?
Here efficiency would mean whether the application is such architecture is able to se... |
Problem: A single client of our system can completely flood all available resources with a massive workload. You can consider we have only one queue, and anyone can schedule any amount of work in it. Any other client that subsequently submits a small amount of work will have to wait until the first tasks have been full... |
The gist of my problem is that I'm trying to make a basic simulation for periodically collected data.
More specifically, given the position of a radio antenna, the RF patterns would be simulated using the Python library Pylayers, where the finished model is constructed in matplotlib for viewing.
I want this to be done... |
How keys should be designed in a Key-Value Store?
For example if there is a need for querying users based on their emails (a manual secondary index), should the key be user:email_index:user@domain.com or user:email_index:<SOME_FIXED_WIDTH_HASH>?
If so, what hash algorithm should be used? Is there a sequential hash algo... |
I really liked the concepts in the video The Principles of Clean Architecture by Uncle Bob Martin. But I feel like this pattern is like a combination of Abstract Factory and Builder patterns at its core.
This is one way to write good programs but not the only way.
Rails and React are 2 frameworks that come to mind that... |
I'm not sure how to correctly describe my problem...
Ever since I started learning how to program, I recognized that many more experienced programmers have very strict (and, in the POV of a beginner, completely artificial) rules how should programs be written. These rules seem simplicistic, yet are followed with an alm... |
I am now working on a project that started as university homework and actually, still is a university homework (not turned in yet...) and, if I'm successfull (that doesn't mean turning it in and getting a better-than-failing grade, that means bringing it to publication quality), this is going to be the largest piece of... |
Our system generally processes in two services which are run under IIS. Service A gets HTTP requests, parses the content, and shoots it to RabbitMQ. Service B takes messages from RabbitMQ, parses them further, and writes them to a database.
IIS can detect when it should spin up more worker processes for Service A, beca... |
I've a project where the users will be able to tags themselves with skills tags (maybe predefined in the system) , and then the project managers on a company would be able to search the best user with a set of skills for a given task. For example : Java would be a tag, or maybe Android , etc. I'll use a relational DB.... |
More specifically, with regards to ATDD (sort of BDD flavored, or some could argue what was actually intended in the first place by TDD) should be there much UI testing?
As I have been testing my UI components on my flavor of the month client-side MCV framework I find that I haven't really been testing much in the comp... |
My understanding of this is that object pools are useful when we want to work with an object but we want to use one that's already been instantiated. It's like a library book - you check out a book and you return it when you're finished reading it.
However, I struggle to see how this design pattern is used in real life... |
In my app two components A and B, have their data and state based on the data and state of a 3rd component, component C:
Both A and B can change the data of component C.
Both A and B listen to changing of data of component C and react to
it by re-computing their internal data and state.
A and B each run on their own ... |
When creating single page apps that communicate with a backend API via ajax, what is common (best?) practice regarding updating different server side database objects as a result of one client side action? For example let's say I delete something on the client which in turn results in needing to update several other it... |
In my new SPA (Single Page Application), I have teachers, which can make tests, and students, which can take tests, subscribe to teachers, and view their grades. This means that in JavaScript, they will both have very different actions they can do. But the HTML and CSS, incidentally, are very similar. My goal is to mak... |
I've recently seem event storming as a quite reasonable way to get understanding form a domain, in order to build a domain model. We understand the events in the domain, which for the domain experts ends up boiling down to just telling the business processes they are used to in their everyday life, then we find out the... |
I have generated the program graph of a method that contains an if condition and a for loop, and I need to generate test cases that covers "every branch". Would this include the for loop, given that program graphs are abstractions of the actual code, and the for loop does cause there to be two separate paths in the pro... |
Given a requirement like
if A and B and not C then D must happen within 10ms
That can clearly be tested albeit at the cost of some pain proving the 10ms bit, but what happens if the requirement was instead
if and only if A and B and not C then D.....
It seems to me that the only if likely requires an exhaustive ex... |
I have 3 projects in my solution :
An ASP MVC project
A console app project
A class library project (the DataAccessLayer)
I didn't want to recreate an ADO.net entity data model for each project so I've "simply" created a new class library project and added the ADO.net entity data model inside it. Is it an usual way t... |
I've recently started a C# programming job, but I've got quite a bit of background in Haskell.
But I understand C# is an object-orientated language, I don't want to force a round peg into a square hole.
I read the article Exception Throwing from Microsoft which states:
DO NOT return error codes.
But being used to Ha... |
We are designing a web API to transfer objects obtained from a database to a client application which is a front end GUI. The server side business logic will be implemented (for better or worse) in stored procs.
To minimize the size of transferred objects, integer ids will sent in the case that an object references ano... |
I'm currently working on my graduation for my "Software Development" studies, in which I have to develop complex software individually in an external company. This all needs to be done in a structured manner, creating all corresponding documents.
For this project I have chosen to work with the IEEE standard documents: ... |
I wrote a Java API that accepts ClassLoaders as parameter, even though it won't accept any ClassLoader that isn't a URLClassLoader (because I'm only interested in the URLClassLoader::getURLs() method):
/**
* @throws NullPointerException if classLoader is null.
* @throws IllegalArgumentException if classLoader is not ... |
I understand "devops" to be the application of the development processes (issue tracking, version control, release management...) to operations tasks (deployment, migration...).
Is there an equivalent term for the application of development processes to QA tasks (testing that only a human can perform, rather than autom... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.