Unit Tests code duplication?
How can I avoid code duplication in unit tests?
Is it OK for a function to modify a parameter
We have a data layer that wraps Linq To SQL. In this datalayer we have this method (simplified)
Unit Testing: “It’s a code smell if you’re refactoring and there are no collaborators”?
I’m reading The Art of Unit Testing by Roy Osherove. I’m at section 7.2 Writing maintainable tests where the author has this note about code smell:
Are flag variables an absolute evil? [closed]
Closed 8 years ago.
At what point/range is a code file too big?
I’m finding lots of 2-3k line files, and it doesn’t really feel like they should be that big.
is this javascript property defaulting pattern a code smell?
In some javascript code I’m working on refactoring I’ve handled cases where I wanted to default an object property to true without having to go through the code-base and add the property to every instance of the object by doing something like this:
Is this a test smell or is it even worse?
I have recently been looking at some testscripts which looks a bit like
How do I handle having so many SQL queries?
I have an MVC3 project that uses SQL Server.
Should I check integrity in my application code or defer to the database? [duplicate]
This question already has answers here: Should my multi-server RDBMS or my Application handle database Referential Integrity? (5 answers) Closed 11 years ago. At work we have a lot of code like this (pseudocode): response form_submit(string username, string password) { if ( username == “” || username.contains(invalid_chars) || password.length < 5 || … ) { […]
What does the “4” in LCOM4 mean?
I know that methods in a class should have high cohesion which roughly translates to having all the methods use all the instance variables directly or indirectly. I know that LCOM4 (Lack of cohesion)metric is useful for having a quantitative figure of how much cohesive the methods in a class are. A class with a LCOM4 value of 1 will be considered pretty good while a class with LCOM4 value of, say, 10 is considered a poorly designed class and this probably tells that we are better off decomposing the original class into 10 separate classes. All this is okay but what does the 4 signify in LCOM4 metrics?