# Tag Info

16

Just like a unit test should test behaviour not implementation your department should measure the anticipated result of the policy, not implementation of the policy. Your department wants to move to TDD. Why? What is it you're hoping to achieve through TDD? Fewer bugs raised that are regression related? Faster velocity on cases? Then you should measure ...

10

There's no way to accurately do this. For example, who contributes more: someone who commits 1000 lines of code in a month, or someone who spent most of his time thinking really hard, and then committing 100 lines of code that replace the 1000 lines of code? Or how about somebody that goofed off most of the month, then found those same 100 lines of code in a ...

9

Not only is it hard to say, but the answer is not very useful. Even highly experienced developers find it difficult to estimate how long a given project will take them. This is largely because the programming process consists mainly of understanding the problem fully, and elaborating a solution. The hard part is the full understanding. Writing the ...

8

If you use vector algebra (which is easy with a vector algebra library), there is no real difference between the 3-d case and the N-d case. Unfortunately, the page you link to has written out the vector math element by element, which tends to obscure this. So, paraphrasing from the article: given a line through two points A and B, the minimum distance d ...

4

what does it mean by "clearly defined rules"? It means rules that are clearly defined. For example, Source Lines of Code can be defined as physical lines of code (the number of lines separated by a carriage return), or the number of logical statements. Your assessment of the size of a program would depend greatly on which definition you use. is “blue” ...

4

If your app will potentially be used outside the USA, Myanmar or Liberia, or will it interoperate with other systems, I'd suggest you use the more widely accepted measurement system to store the data and then convert it to whatever local mesurement system the user wants to display. Obviously the columns shouldn't be integers but real. The metric system is ...

4

Square metres stored as an integer may not have enough resolution to capture what you need to know. Converting to and from square feet or metres will lose information. Use floating point values to prevent this issue. Use whichever unit your primary users are likely to want for storage. If you are only targeting a US/UK market (where square feet is the ...

3

Neither. Since you are asking this question, you are probably working on a system which uses both (or a system which will be used in different countries). This means that you should be able to store distances expressed in feet or meters. In your database, do have not one, but two columns: one for the value, the other one for the unit. This would make it ...

3

When you find a statement like "M number of comparisons" about sorting algorithms in literature, the author typically means the number of comparisons between the sorted elements, not the comparisons of something like loop indexes. So if you are asked this in a university assignment, I would guess that this is the number which is meant (but to make that clear,...

3

One great resource: http://bigocheatsheet.com/ I can tell you right off the bat that: Bubble Sort is in worst case, O(N2) Insertion Sort is in worst case, O(N2) Selection Sort is in worst case, O(N2) Quick Sort is in worst case, O(N2), yet is typically O(n log n) Merge Sort is in worst case, O(n log n)

3

By far, the language question is a matter of fashion. The best language for getting stuff done is the one you know. The best language for personal development is one you don't. C would work just fine.

3

It is hard to tell what metrics to collect for an unknown project with unknown goals. I would strongly recommend you to take a look at some kind of goal definition approach (such as GQM). Using this methodology you might come with metrics that best suit your needs. Basically, GQM (goal, question, metric) defines a process where: you first define your ...

2

How long you spend developing requirements. This is to see if the overhead is worth the benefit. Average time to implement a requirement (requirements per hour or day). Some tasks are unavoidably complex, but in general, better-defined requirements don't take as long to implement. How often requirements change between requirements development and the end ...

2

TDD is not something a team commits to doing. It's only a means to an end. Objectives can be writing more maintainable code, decreasing the number of defects, delivering faster, or improving test coverage, but not "doing TDD". TDD is not a silver bullet. Measuring "if the team is doing TDD" does not guarantee success like making sure they drink their magic ...

2

The way you measure the ROI depends on the effect of the projects on the overall product. For totally behind-the-scenes work (library improvement or replacement, implementation language, etc.), you would probably look at server load, system performance, defect rate, future/estimated engineering time savings, etc. For a user-facing feature, you would look at ...

2

Do all non-functional requirements need a specific metric and measurement? No. They just some form of verification, which is sometimes trivial. For example, an NFR might be "the application shall be based on the Microsoft stack" which is pretty easy to check. That being said, having clear acceptance criteria is almost always a good idea, and this ...

2

No such index exist to my knowledge, and I don't think testability is quantifiable in a meaningful way. The criteria you mention are indeed quantifiable, but they are not really related to testability. Static methods or direct instantiation of objects does not prevent you from testing code. It just prevent you from mocking. But the need for mocking is ...

2

Because the effective difference between 1 and 2 operators/operands in a program is larger than the difference between 101 and 102. Logarithms were chosen to model that diminishing significance. Why base 2? Eh, probably because we're computer nerds. If Halstead had chosen base 10 or base e it would still produce a model that would roughly compare two ...

1

The following will show, for each file in current HEAD, the number of times it has been changed (number of commits that touched it), the number of lines that were added and deleted, where a change in a linge is both an addition and a delete: for f in \$(git ls-tree -r master --name-only) ; do \ git log --numstat --oneline "\$f" | grep -E "\$f\\$" | \ perl -ne '...

1

You can get the number of times a file was committed by using: git log --format=oneline [path_to_file] It gives results like this: 078d420881d6000e3d545dd22d78f0d6c7f75805 (HEAD -> master) Allow user to adjust width of the effect. 8b63fa83ae3808d8f745b91c23f64d8628ae73b9 First working version. 6e4c20fe911bcddedc82e5b8b732744b84447b08 Initial Commit ...

1

You can usually collect RAM / disk / CPU / network usage from SNMP data, just enable snmpd. Choose your monitoring solution; anything from something as small as Monit or Icinga to something large like OpenNMS will readily show you these. Write more to logs, at least during the development and load testing; timestamps uncover a lot. But this may become slow ...

1

The planning of a scrum sprint has two components. On the one hand, you estimate the complexity of the stories and tasks on the backlog in the unit of Story Points. More on that later. On the other hand, you how many story points the team can deliver in one sprint. This is called the velocity and it is based on the historical data of how many story points ...

1

The same (both PL and library) that you'd use for production because libraries differ in implementation details, and benchmark from one PL/library is not representative of performance with another PL.

1

To ensure team is following test driven development is to calculate DEFECT DENSITY. You can agree mutually within the team/stakeholders to find this for the number of lines. We had 50 lines. That means, 1 bug per 50 lines will be quite ok to fix. So, if you want to keep 1000 lines as standard, then you should not exceed 20 bugs. DEFECT DENSITY = Bugs ...

1

If a team truly wants to do TDD, they you just need to do some minimum tracking to satisfy the rule. Check in your tests first and then check in the code and after comparing the initial dates, you have some semblance of proof. To have another layer of approval, make this a part of the code review where someone can verify these are meaningful tests. It's not ...

1

Since you want to switch from a test-second development to test driven design, you can best measure that by looking for proof that the tests were written before program was changed. Teach your team to commit their failing tests first, so they can be measured, and then write the code to pass the test. You may need to either manually inspect the repository ...

1

Since you are going to measure unit test separately (code coverage, decision coverage, etc.), let me add a couple more tweaks to the process. All check-ins must go through code review. Code reviews should be trackable, i.e, should not be an over-the-shoulder review or like pair programming. You should be able to retrieve the code review comments, iterations ...

1

I don't think you can do this, at least in the sense you suggest. Bryan's answer, and several answers in the question linked by gnat discuss several intangible (perhaps we should call them "immeasurable" in this context) productive activities. Specifically, this: I'm trying to think of a workflow where a group of developers can work seamlessly ...

1

Express the line as a function of a single parameter t. Call it X(t). The distance from a point P to a point on the line X(t0) is just u(t) = || X(t0) - P ||, and you don't actually need to do the square root. Now find the value of t that minimizes u(t). The standard method from first-semester calculus is to form the derivative du/dt, set it to zero, and ...

1

Hard: Log Total Time If you have a <script> section at the end of your HTML page, it won't get executed until the rest of the page is fully loaded and probably rendered (but check me on that). Note that the client and server probably won't have the same clock time, but you could have a <script> tag at the end of your document send an AJAX ...

Only top voted, non community-wiki answers of a minimum length are eligible