问:
Estimation of your backlog
How far in advance should you estimate stories in your backlog?

My concern is that estimates that are 6 months out will become out of date as you develop features in the current sprint. I thought that with agile you re-estimate your current sprint.

答:
Estimates do become out of date. We gather more information and learn new things, and some jobs will seem easier than they did a week ago and some will seem harder.

Why do you think that's a problem?

An estimate is nothing more than an educated guess, based on all the information available to you at any given time. It can be changed. If you find that jobs that involve file access always take longer than you estimated back in June, increase the estimate on all jobs that you know involve file access that you estimated back in June. Reestimate any other jobs that involve file access that you've estimated in between.

Or, when the business decides to add something to the upcoming sprint, if you look at it and think "We must have been mad when we estimated that!" then don't be afraid to tell the product owner that. It keeps their expectations under control.

The fact that estimates are going to change is never an excuse to not estimate them now. If you don't then you'll never spot that tiny job with medium business benefit among the massive jobs with massive business benefits.

Title: Estimation of your backlog


答:
Our practice was to estimate stories as they were created (if possible) and to add a flag to the fib number to indicate that it will need to be resized closer to implementation.

In our case, the flag was a .1. (ie 13.1 means that "we think this is a 13, but we should revisit that later.)

ContentLicense: CC BY-SA 3.0

Title: Estimation of your backlog

Body:
How far in advance should you estimate stories in your backlog?

My concern is that estimates that are 6 months out will become out of date as you develop features in the current sprint. I thought that with agile you re-estimate your current sprint.


问:
When should one give source code to a client?
I am a member of a small team who developed software to control the hardware of a robotic device.

Now the customer demands to see our commercial code.

Our promise was just to develop the software and make his machine work. (He failed to program the robot himself, that is why he hired us).

But the project did not start as a hiring agreement, more as a develop and make it work, we did lots of research to make his robot even possible to work

I wonder if we should give the source code? I have serious doubts about releasing the code. I believe the customer is planning to steal our c++ / c# code.

We provided him the executables installed on the finished programmed robots.

Our code wasn't developed just for his robotics device, but is part of our libraries we use commonly in various projects.

When can a customer claim that he owns software? And when he does what does it mean. I mean having the c++ code, having a disassembler code, having c# code?
Where does it end?

We gave our software to an escrow agent, and we believe that is fair. But giving them our code seams to us unfair, knowing that customer will then go on to develop based upon our code.

Parts of the code also use a home developed software protection, which we cannot give due to that it is used in other products.

答:
There are always two sides of a story. More important here whether you want to keep good relationship with your client and build reputation in your business. Let’s imagine you are right and there were no words in the contract regarding source code. Does it really matter? There is always space for negotiations if it’s pure business question. You may agree on new contract conditions – “I give you source code and you pay me money”. How many man-hours did you spend on development of your common libraries? This is good starting point for estimation.

Some people successfully sell GPL software – think about it. If you want to be sure that your client will not steal your intellectual property make it impossible or difficult for him to do. You can provide source code under Affero GPL – this would be good joke.


问:
How do you deal with time estimates?
If given too little time, quality suffers. If given too much time, developers will find a way to use all alloted time, no matter what. What would be a good way with dealing with estimates? Are they a necessary evil?</p>

答:
Of course they're necessary but they're not intrinsically evil, they're just done badly.

The basics of a good estimate:

1) Developers, ideally the ones who will do the work, have to be involved in generating them.

2) An estimate is a range (usually best case, worst case, most likely case), not a single value.  You may use the range to approximate a single value ((best case + 4* most likely case + 2 * worst case) / 7 being a fair formula for doing so) but never forget that that's all it is - an approximation.

3) In my experience the most common reason for bad estimates is wishful thinking, either on the part of the developer (who is optimistic it will all go fine) or the manager (who is desparate for it all to go quickly).  This needs to be fought - any estimate based on everything going well is pretty much a cert to be massively under.  Most likely case should probably assume that a certain amount of stuff isn't going to go the way you want it to.

4) In my experience the second most common reason for bad estimates is not thinking through everything that has to be done.  It's not just the coding, it's the unit testing, the admin, the user guide, the back end maintenance screens relating to the functionality.  Break down the task into individual components each taking between quarter of a day and five days - that sort of size can be estimated with a reasonable level of accuracy.

5) Measure the actual time things took and review afterwards and use that to improve estimates.  Refer to actuals for similar previous tasks as a bench mark and to justify why things are higher than might be expected.

6) Estimate both at the micro level (each individual task) and the macro level (gut feel on how long the whole thing should take).  Usually the macro level estimate will be lower - this is an indication that you might want to review (but not necessarily change) the micro level estimates.  The sweet spot in my experience is when they either agree or, more likely, the macro level estimate is still lower but no one is willing to change any of the individual task estimates.  At that point you use the individual task estimates.

7) Don't confuse the estimate and the commercial aspects.  If you estimate 100 days and the usual charge out rate is $1,000 per day that should obviously be $100,000.  If they say they can't charge that and win the business that's fine but (unless the scope changes) the estimate doesn't change, the charge out rate does.

8) Developers should be challenged on their estimates (as in asked to explain why something takes that long) but not pressured to lower them.  Certainly not just because the numbers aren't what someone wants in any case - if they can't justify them then they usually need to be pushed for a better breakdown and potentially a second set of eyes but in a non-confrontational manner - remind the PM (or if you are the PM remember) that they're going to look bad if the project isn't delivered on time too so they should be keen that the estimates are solid.

9) Contingency should be added both shit happens contingency (usually 10 - 20%) and to cover specific risks.  Contingency should be planned in but is "owned" by the project manager - that is if a developer needs to go into it he has to speak to the PM and say why he's over run his estimate.  This usually helps stop the just filling time and keeps contingency for genuine stuff.  If anyone objects to your shit happens contingency budget then explain it's just the reality of IT projects - stuff happens you can't predict.  If they still don't like it then remember to hide it inside the estimates next time.

10) (Edit) Don't confuse effort and elapsed time.  Effort is the total time that will need to be spent doing something, elapsed is the difference between when it starts and when it ends.  They're normally different - admin, support, mentoring and life mean that the chances are that you won't get 5 days effort completed in a working week.  Take 4 as a rough guide but adjust according to the company and the other commitments of the team members.

11) (Edit - from Martin Wickman) Other work you've done or are planning can be a valuable source of information when estimating.  In the comments below Martin refers to Relative Estimating which involves comparing like tasks with each other to ensure that the estimates assigned seem in proportion given the work involved.  It's surprising how often you'll happily assign 1 week to one task and 1 week to another but when you look at the two things one is clearly more complex than the other - that's a good indication that one (or both) figures are wrong.  Taking this further you get into evidence based scheduling which uses completed tasks and projects as a key input into estimates for future work - at a very basic level "how long did it take last time we did something like this?"

Steve McConnell wrote about all of this in Software Estimation.  It's a bit dry but it's very thorough on the subject.

ContentLicense: CC BY-SA 2.5

Title: How do you deal with time estimates?


问:
delivering ebook throught mobile app
I have designed the interface of a mag app which would deliver digitized magazine in the size of A3 paper to the mobile phone.

My choice of fileformat is jpg of each of the pages, but is there any better way to do this that using jpeg format.

The file for one sample magazine was 16MB, and I'm stuck weather to deliver page by page or as a whole file which can be flipped

答:
ePub is a standard format for e-books.  In particular, the ePub v3 standard is designed for texts that require specific layouts, like magazines and comic books.  Being a standard, many e-book readers can already display ePub files.  So you might not even need an app (if you don't want one).  Another option is, of course, PDF, which can be viewed on most devices as well.

Delivering the magazine as a JPG per page would take a lot of bandwidth and storage space.  And since you aren't delivering text, would make it difficult for readers to search.

Title: delivering ebook throught mobile app


问:
Choosing value in SQL query vs (Java) code
I need to choose one of three values of an integer using the value of a column on a nullable column of a table.

There are at least two approaches: 1) use SQL to do all the work: test null values, and choose between the other values, or 2) read the value and use code -in this case Java- to choose.

Which one is "better", ie. easier to understand & more maintainable? Do you have any other metric use to decide?

As an example, I have the following code:

```<code>// If id is equal to:
//   -1, then make v = 1
//   null, then make v = 2
//   in any other case, make v = 3

// Option 1:
int v;
String query = "SELECT CASE min(Id) WHEN NULL THEN 2 WHEN -1 THEN 1 ELSE 3 END AS Id"
        + "FROM TableA WHERE SomeField IN (SELECT ...blah blah...)";
ResultSet rs = // execute query
if (rs.next()) {
    v = rs.getInt("Id");
} else {
    // TODO something went *very* wrong...
}

// Option 2:
int v;
String query = "SELECT CASE min(Id) Id"
        + "FROM TableA WHERE SomeField IN (SELECT ...blah blah...)";
ResultSet rs = // execute query
if (rs.next()) {
    final int id = rs.getInt("Id");
    if (rs.wasNull()) {
        v = 2;
    } else if (id == -1) {
        v = 1;
    } else {
        v = 3;
    }
} else {
    // TODO something went *very* wrong...
}
</code>```

答:
As industry best practices, we need create a stored procedure to handle that logic. Java code's work is to execute the stored procedure(SP) and get the output.

It will be easy while changing the logic in future. If it is SP, we just need to modify the logic by altering the stored procedure.

If you are writing in java. we need to build and deploy the whole project again. As a developer we do make mistakes by checking in or out the wrong version of code from or to production. It will cause issue after the deployment.

So. stored procedure is always best way.


答:
If you have discussed about sharing the source code the customer during project plan, you should give the code.

if customer is asking at the deployment stage, its your own personal decision.

Also it should be a part of your agreement with the customer, whether you should share it or not.

Title: When should one give source code to a client?

Body:
I am a member of a small team who developed software to control the hardware of a robotic device.

Now the customer demands to see our commercial code.

Our promise was just to develop the software and make his machine work. (He failed to program the robot himself, that is why he hired us).

But the project did not start as a hiring agreement, more as a develop and make it work, we did lots of research to make his robot even possible to work

I wonder if we should give the source code? I have serious doubts about releasing the code. I believe the customer is planning to steal our c++ / c# code.

We provided him the executables installed on the finished programmed robots.

Our code wasn't developed just for his robotics device, but is part of our libraries we use commonly in various projects.

When can a customer claim that he owns software? And when he does what does it mean. I mean having the c++ code, having a disassembler code, having c# code?
Where does it end?

We gave our software to an escrow agent, and we believe that is fair. But giving them our code seams to us unfair, knowing that customer will then go on to develop based upon our code.

Parts of the code also use a home developed software protection, which we cannot give due to that it is used in other products.


答:
The answer to your question is another question.  Why are you encoding these results as arbitrary integers 1, 2, 3?  Is it for some external Java API, or an internal API that you cannot modify?  If so, then do the translation in some Java wrapper around that interface.  That will prevent repeating this translation in multiple queries.

== Addendum ==

According to OP, these are magic numbers that stand in for an event type.  In that case, I would go ahead and do the translation in the query.  If I created another query that needed to repeat that translation, I would factor the translation into a view.  But I wouldn't call the resulting column "ID", which tells me nothing.  I would call it "event_type".

Title: Choosing value in SQL query vs (Java) code

Body:
I need to choose one of three values of an integer using the value of a column on a nullable column of a table.

There are at least two approaches: 1) use SQL to do all the work: test null values, and choose between the other values, or 2) read the value and use code -in this case Java- to choose.

Which one is "better", ie. easier to understand & more maintainable? Do you have any other metric use to decide?

As an example, I have the following code:

```<code>// If id is equal to:
//   -1, then make v = 1
//   null, then make v = 2
//   in any other case, make v = 3

// Option 1:
int v;
String query = "SELECT CASE min(Id) WHEN NULL THEN 2 WHEN -1 THEN 1 ELSE 3 END AS Id"
        + "FROM TableA WHERE SomeField IN (SELECT ...blah blah...)";
ResultSet rs = // execute query
if (rs.next()) {
    v = rs.getInt("Id");
} else {
    // TODO something went *very* wrong...
}

// Option 2:
int v;
String query = "SELECT CASE min(Id) Id"
        + "FROM TableA WHERE SomeField IN (SELECT ...blah blah...)";
ResultSet rs = // execute query
if (rs.next()) {
    final int id = rs.getInt("Id");
    if (rs.wasNull()) {
        v = 2;
    } else if (id == -1) {
        v = 1;
    } else {
        v = 3;
    }
} else {
    // TODO something went *very* wrong...
}
</code>```


问:
High-Level SQL Interoperability
In a server -> client scenario, wouldn't it be simpler and faster to grant a public user access to a Stored Procedure rather than using web services (XML, REST, SOAP, etc) and other interoperable solutions?

That way you could connect directly to a database and get relevant content and do what you will with it in the same way across all languages and systems?

答:
Apart from security reason.
1) Will every one knows how to access the data through stored procedure?
2) Will every once have querying tools in their PC\Laptop?

If it is a client requirement we need to satisfy it. Also, we need explain the security issues when database server is exposed to internet.

Title: High-Level SQL Interoperability


问:
Using error numbers which only work on 64 bit servers: a bad idea?
In an attempt to solve one problem I encountered another. I would like to have an easy and memorable way of creating unique error numbers, across projects and across developers. The scheme I came up with was to use the initials of the developer, find their position in the alphabet, and append the date and time.
Example: lets say the developer Mark Elliot Zuckerberg (initials MEZ) writes code that throws an exception on Feb 8th 2014 at 12:54AM. The error code would be: 8526020820140054

This works brilliantly on 64 bit machines, but the resulting integer is too large for 32 bit computers. Does that make this a bad idea? How common are 32 bit servers, and do we expect them to slowly disappear completely?

答:
My advice is to migrate your code to 64 bit OS and processors. When you are purchasing new PC, Laptop or server go for 64bit. Currently Microsoft doesn't have the Server edition with 32bit, it only have 64bit Windows server 2008 and 2012.

Reason behind is 19 January 2038 32 bit computers date will be resets to  1 January 1970, please refer the below link.

http://en.wikipedia.org/wiki/Year_2038_problem

If your application does loan interest processing on Jan 13 2038, your 32bit computer automatically reset the date to Jan 1970 and company might have a chance to pay interest to customers.

Again, you will have a question when 34 bit OS date will reset. It will take some billion years to reset.


答:
This is a very bad idea.

You want "Easy and memorable". You've already discovered that your solution isn't easy.

You're considering backing yourself into a 64-bit corner to solve this problem.

What happens when Mary Smith and Mike Simpson join the team?

How can you guarantee uniqueness of the numeric part?

Whenever you rely on programmer memory, you place additional cognitive burden on your programmers. That will either be a distraction from coding, or will get forgotten

You're re-inventing the wheel. GUIDs already exist, and can be converted to 128-bit integers.

32-bit machines can handle 64-bit numbers perfectly happily.

3rd party libraries won't follow your scheme.

Are you solving the right problem? What is the benefit of unique error numbers? How important is this requirement to your clients?

Title: Using error numbers which only work on 64 bit servers: a bad idea?

Body:
In an attempt to solve one problem I encountered another. I would like to have an easy and memorable way of creating unique error numbers, across projects and across developers. The scheme I came up with was to use the initials of the developer, find their position in the alphabet, and append the date and time.
Example: lets say the developer Mark Elliot Zuckerberg (initials MEZ) writes code that throws an exception on Feb 8th 2014 at 12:54AM. The error code would be: 8526020820140054

This works brilliantly on 64 bit machines, but the resulting integer is too large for 32 bit computers. Does that make this a bad idea? How common are 32 bit servers, and do we expect them to slowly disappear completely?


问:
Doesn’t active record violate SRP and OCP?
I have watched the active record classes in our project grow into large, do-it-all classes. When you need anything about a user, for example, you should go to the Person class. While this makes perfect sense when you consider the domain, in reality, the Person class is a mishmash of lots and lots of functionality, which do get modified sometimes as the domain becomes clearer, which means both SRP and OCP are violated.

Is this one of the things that comes with the Active Record pattern, or are we doing it wrong?

答:
The typical use of AR violates these principles.  Many developers dump every possible piece of functionality into their models making them fat and cumbersome.  The fact that AR makes database interactions an afterthought aids in the misuse.

What you could do is make use of the repository pattern.

Use it to separate your data persistence code from the business logic thus hiding away the details of AR.  Then separate your use cases into single responsibility classes. Recently this has been dubbed DCI and it's starting to gain some traction.  This will keep your models uber-light and use cases will become more clearly articulated in real classes.  Learning to make use of DCI takes some practice but there are a growing number of resources out there and really, once you grok the concept, you shouldn't have much trouble using it.  (Don't worry if you make some initial mistakes.)

By taking this tack you wouldn't be tightly bound to AR.  You could very easily create interfaces that use the filesystem or any sort of persistence.  By making your persistence layer more of an afterthought, you'll have improved your architecture dramatically.


问:
Quality Assurance (Testing) in Scrum
I just had a Release Retrospective for my scrum team.  We talked a lot about our release process.

I pointed out that because our company is not able to tolerate bugs in our production environment we are not be able to adhere to the traditional scrum mantra of releasing often.

In short, we are a medical company.  Bugs in production can cause issues with patient care.  (A rapid fix release does not help the patient that was negatively impacted by the bug.)

I pointed out that scrum does not have a formal quality assurance process.  (It is assumed that testing will be done during development.)

I then stated that scrum has an implied expectation of bugs in production.  (Based on the process of releasing early and often.)  The Scrum Process people in the room said that scrum is not that way.  They said that properly done scrum can be bug free in production.

So here is my question:

How does testing and quality assurance work for scrum? (So that there is very low occurrence of bugs in production.)

OR

Is there documentation that bugs are expected to a small degree in Scrum (along with quick follow up releases)?

NOTE: This is for full enterprise level development. We have 6+ WCF services, several Service Buses, 4 databases, a WPF front end application and a Web Interface all written by two separate scrum teams of about 6-8 people each.  This means answers that include just coding it right the first time are not realistic.

NOTE II: I know that no software product is going to be bug free.  But our release process (non-agile) catches the few that get past our development process and brings our software fairly close to the "No Bugs" level.

答:
In my experience, it all depends on how flexible you are able to handle the whole SCRUM-thing. If you need a bug-free release, why don't you add a QA Stage before actually releasing the product to the customer?

The QA Team decides there, if you can ship it to the customer - if it's bug free enough. If not, they'll create bug-reports for you that you can tackle during your next sprint.

Title: Quality Assurance (Testing) in Scrum


答:
Two issues here:

1) "unique error codes across products. BAD idea as others have already indicated

2) "32 bit servers. Do those even still exist? And if so, do you really think the people operating them are going to want to pay for your product if they've not seen fit to upgrade their hardware and operating systems in the last several years?


答:
The phenomenon you are referring to is known as Parkinson's Law, which states "Work expands to fill the available time for its completion."

That is, people have a tendency to pace themselves to finish things just in time for the deadline. I don't think it is a result of laziness, but more a consequence that there is always more to do than time to do it, so you prioritize things according to when you have to deliver them.

The best solution to the deadline dilemma, in my experience, is an iterative process that breaks the project into small frequent deliverables. This keeps the sense of urgency up and also helps to keep the estimates realistic as it is much easier to estimate a small task than a larger one. Be careful though to give the developers a lot of input and control over the deadlines. A manager who dictates a million tiny deadlines = a micromanager.

In any case, deadlines should be set by real business constraints. Creating deadlines based on estimates of how long it will take to do the work is somewhat akin to using a ruler to measure itself.

Title: How do you deal with time estimates?

Body: If given too little time, quality suffers. If given too much time, developers will find a way to use all alloted time, no matter what. What would be a good way with dealing with estimates? Are they a necessary evil?</p>


问:
How to decompose / model a chessboard
As someone new to programming, I am building a chess web application in JavaScript, both for fun and to learn more about design patterns. I keep running into a wall, which is how to decompose the program.

To start, I have picked a straightforward representation of a chessboard, here:

```<code>Board = function() {
  var turn = 0;
  var model = [[-4, -2, -3, -5, -6, -3, -2, -4],
               [-1, -1, -1, -1, -1, -1, -1, -1],
               [ 0,  0,  0,  0,  0,  0,  0,  0],
               [ 0,  0,  0,  0,  0,  0,  0,  0],
               [ 0,  0,  0,  1,  0,  0,  0,  0],
               [ 0,  0,  0,  0,  0,  0,  0,  0],
               [ 1,  1,  1,  1,  1,  1,  1,  1],
               [ 4,  2,  3,  5,  6,  3,  2,  4]];
</code>```

with some basic access routines, such as

```<code>  this.move = function(pt1, pt2) {
    turn += 1;
    model[pt2.x][pt2.y] = model[pt1.x][pt1.y];
    model[pt1.x][pt1.y] = 0;
  };
  ...
</code>```

It makes sense that the board encapsulates state and is responsible for changing state but may not know the rules of the game--I like the idea of being able to plug in some sort of RulesContoller and completely change the nature of the game at runtime. But beyond that, I'm a little paralyzed as to how granular to model the pieces. I see a few options.

First, I could define a Piece constructor and instantiate a new piece for each index in the nested array, something like:

```<code>  _.each(state, function(row, y) {
    _.each(row, function(val, x) {
      state[y][x] = new Piece(x, y, val);
    });
  });
</code>```

Piece could easily deduce its color, type (e.g. 'king'), and location from that information. But it also feels redundant, since I'm just translating a model that already completely represents the board. Also, it doesn't seem like the primary purpose of the Piece 'class' is this translation, e.g. "Oh, I'm a -5, must be a dark Queen."

Another option is to make the pieces dumber, i.e. not able to deduce this information from the model. But then I just build the array in-line, like

```<code>  var model = [new Rook(1,1,'dark'), new Knight(1,2,'dark'), new Bishop(1,3,'dark')... ],
  ...
</code>```

This seems closer to the way a chessboard is actually setup: there isn't some elegant formula; rather, you just put pieces in their correct location. But it's also just brute force. There are a few symmetries involved and patterns that might be simplified.

Anyway, I'm just spitballing at this point. Any ideas would be useful. Thanks.

答:
This sort of application is perfectly suited for functional programming.  Create a few data structures (using prototypal inheritance pseudo classes) that track the state of the game: essentially the board state and the turn state.  Board state tracks where all the pieces are.  Turn state tracks whose turn it is.  Together these two structures make up game state.

```<code>var state = new Game(new Board());
console.log(state.activePlayer) //white
console.log(state.board) //multi-dimensional array or some other construct
state = state.board.move(["Kf5", "Kd5"]);
</code>```

All your persistent data structures supports is the actual visible state of the game.  You never actually change the values of the data structure, but instead copy them into a new, but modified version of the data structure.  This is ideal for allowing the computer to explore different moves (inside Web Workers?).

Then all you need to do is to start developing a few supporting functions that actually do the work of proposing moves.  The most generic would be:

```<code>var suggest = AI.suggestMove(state); // ["Kf5", "Kd5"]
state = state.board.move(suggest);
</code>```

Using functional techniques you're left only with data structures and functions and you won't need too many object constructors.  This leaves you primarily to think about your functions (how to make the AI smart enough to win).

Title: How to decompose / model a chessboard

Body:
This sort of application is perfectly suited for functional programming.  Create a few data structures (using prototypal inheritance pseudo classes) that track the state of the game: essentially the board state and the turn state.  Board state tracks where all the pieces are.  Turn state tracks whose turn it is.  Together these two structures make up game state.

var state = new Game(new Board());
console.log(state.activePlayer) //white
console.log(state.board) //multi-dimensional array or some other construct
state = state.board.move(["Kf5", "Kd5"]);

All your persistent data structures supports is the actual visible state of the game.  You never actually change the values of the data structure, but instead copy them into a new, but modified version of the data structure.  This is ideal for allowing the computer to explore different moves (inside Web Workers?).

Then all you need to do is to start developing a few supporting functions that actually do the work of proposing moves.  The most generic would be:

var suggest = AI.suggestMove(state); // ["Kf5", "Kd5"]
state = state.board.move(suggest);

Using functional techniques you're left only with data structures and functions and you won't need too many object constructors.  This leaves you primarily to think about your functions (how to make the AI smart enough to win).


问:
Is it better to use a switch statement or database to look through 5,000 to 10,000 instances?
I have some JSON data in this format (5,000 instances for now):

```<code>{"id":"123456","icon":"icon.png","caseName":"name of case"}
</code>```

I am allowing the user to search for the name of the case and then return the id and icon to them, and in some situations, use the case id to run other functions, based on the search.

How should I read this data? I'm currently leaning towards a switch because I want the switch to allow me to define multiple cases giving me the same result:

```<code>name of case and name-of-case should return me the id 123456
</code>```

I can easily use a switch based on the string, listing out different cases, to do this. Probably going to be extremely tedious, but it's an option.

So, my options I can think of are as follows:

Run a massive switch based on the query string (probably in a separate PHP file)

Store this result in a MySQL database, then based on the query string, retrieve the data, and I probably need to do indexing (which I understand, but have no idea how to implement).

Also, I would like to prepare for the scenario that this 5,000 instances increases to 10,000 instances at some point in time.

What's the best way of going about this?

Thanks.

答: Always use SQL. The amount effort to read the data from SQL is in your case of complexity similar with a query. So why bother to add extra code?</p>


答:
How does testing and quality assurance work for scrum? (So that there
  is very low occurrence of bugs in production.)

Actually, I don't think SCRUM addresses this. SCRUM does not cover all stages of a product/project. SCRUM is mainly about organizing the development itself - the part from "we have an idea for a feature" to "the dev team thinks this is production ready". It does not cover the very first part of a project (basic idea, project vision, finding stakeholders, getting a budget...), and it does not cover the final delivery (deployment, customer feedback etc.).

So if you feel you need an additional stage after the SCRUM team is done, by all means have a separate stage of QA testing, regression testing, certification, whathever, before going into production.

You still get the value of frequent releases because there is something to test and get feedback from stakeholders - but just because you want feedback does not mean you must ship to customers (though this is often helpful). Note that SCRUM speaks of a "potentially shippable product", because you might not actually want to ship the product for various reasons.

Note: Obviously, the disadvantage of a separate QA/testing stage is that it will take longer to actually ship a feature to customers. However, if quality is more important than quickly shipping new features, then that may be the right compromise for you - that is up to the stakeholders and developers to decide.

Title: Quality Assurance (Testing) in Scrum

Body:
I just had a Release Retrospective for my scrum team.  We talked a lot about our release process.

I pointed out that because our company is not able to tolerate bugs in our production environment we are not be able to adhere to the traditional scrum mantra of releasing often.

In short, we are a medical company.  Bugs in production can cause issues with patient care.  (A rapid fix release does not help the patient that was negatively impacted by the bug.)

I pointed out that scrum does not have a formal quality assurance process.  (It is assumed that testing will be done during development.)

I then stated that scrum has an implied expectation of bugs in production.  (Based on the process of releasing early and often.)  The Scrum Process people in the room said that scrum is not that way.  They said that properly done scrum can be bug free in production.

So here is my question:

How does testing and quality assurance work for scrum? (So that there is very low occurrence of bugs in production.)

OR

Is there documentation that bugs are expected to a small degree in Scrum (along with quick follow up releases)?

NOTE: This is for full enterprise level development. We have 6+ WCF services, several Service Buses, 4 databases, a WPF front end application and a Web Interface all written by two separate scrum teams of about 6-8 people each.  This means answers that include just coding it right the first time are not realistic.

NOTE II: I know that no software product is going to be bug free.  But our release process (non-agile) catches the few that get past our development process and brings our software fairly close to the "No Bugs" level.


答:
Listing 10000 cases manually is a titanic work. You should use a database.

If more than one spelling is possible, you can use an Alternatives table, to fetch the canonical version of a case name.

Title: Is it better to use a switch statement or database to look through 5,000 to 10,000 instances?

Body:
I have some JSON data in this format (5,000 instances for now):

```<code>{"id":"123456","icon":"icon.png","caseName":"name of case"}
</code>```

I am allowing the user to search for the name of the case and then return the id and icon to them, and in some situations, use the case id to run other functions, based on the search.

How should I read this data? I'm currently leaning towards a switch because I want the switch to allow me to define multiple cases giving me the same result:

```<code>name of case and name-of-case should return me the id 123456
</code>```

I can easily use a switch based on the string, listing out different cases, to do this. Probably going to be extremely tedious, but it's an option.

So, my options I can think of are as follows:

Run a massive switch based on the query string (probably in a separate PHP file)

Store this result in a MySQL database, then based on the query string, retrieve the data, and I probably need to do indexing (which I understand, but have no idea how to implement).

Also, I would like to prepare for the scenario that this 5,000 instances increases to 10,000 instances at some point in time.

What's the best way of going about this?

Thanks.


问:
Limitations of using Hyper-V Virtual Machine as .NET Development enviroment
I've been thinking of using a Hyper-V Machine as instead of physical computer for installing my .NET / Azure / Xamarin / ASP.NET / Windows Phone development tools. That way I could easily move from my desktop to my laptop when I need to develop something on the go.

Are there any limitations in this scenario that I should be aware of?

Thanks,

Adrian

答:
I think you'll find copying the hyper-V data files will be a little bigger than you expect, "I could easily move from my desktop to my laptop" .. after copying a 20 Gig hyper-V drive, yes.. first think how long will that copy take.

What you really need is to install the dev tools on both machines (a 1-time cost) and then work on your code using a source control system as if you were 2 people accessing the same repo. When you want to use the laptop, you (ensure you have checked in all the code) check it out on the laptop and work away. When you're ready to move back - commit and checkout on the desktop. You have the benefit of source control too then, and a faster development environment.

You can run the SCM server on the desktop machine and still checkin/out on the desktop too, but then you'll only be able to commit when plugged into the same LAN. An alternative would be to get a "cloud" based repository to commit to.


问:
Is debugging a waste of time?
I work on a lot of projects for fun, so I have the freedom to choose when I want to finish the project and am not constrained by deadlines.
Therefore, if I wanted to, I could follow this philosophy:

Whenever you hit a bug, don't debug. Instead, spend time learning about topics related to the bug from textbooks and work on other projects until one day you can come back to the bug and solve it instantly thanks to your piled up knowledge.

However, maybe the 'philosophy' is bad because

debugging is a skill that should be practiced so that when I need to finish projects by a deadline I will have acquired the skills necessary to debug quickly.

staring at lines of code and struggling to understand them when debugging makes you a much better programmer than writing new lines of code does.

debugging isn't a waste of time for some reason which I hope you'll tell me.

答:
I would approach the topic from the other side: how to avoid creating bugs in the first place? Quality has to be built in, not tacked on afterwards.

Anyway, I feel there's a very simple reason not to allow bugs to fester if you find them: they tend to get worse when left alone.

It even happens quite frequently that the behaviour of bugs is something future development relies on for other functionality. Then when you do get around fixing that bug, you wind up breaking other stuff.

Title: Is debugging a waste of time?


答:
in Scrum each history has a Definition of Done, if one history its considered "done" its because fulfills this definition and its prepared to go to production. If you have productions bugs frequently you must work in have a better definition of done and ensure that the history fulfills this definition.

Scrum its only a lightweight project management technique, when the difficult question like yours arise normally scrum don't have concrete answers. You need to find those answers in other agile methods (like TDD or pair programming from extreme programming). For example a generic definition of done that all your user histories must pass can be something like that:

All unit test pass and coverage its revised

The code is revised (we prefer pair programming, its only an example)

The feature its deployed in test server

The feature its revised by QA people.

Load testing its ok

...

You can add whatever you want, the key its that you must ensure that a user history that fulfills this definition its at the level of quality your project needs and can go into production.

Only two more things about QA

QA people cannot be a separate team, QA people its part of the team. A scrum team needs all the skills to fulfills the DoD.

If your automatic testing (TDD or not) its not enough to achieve the level of quality you need think in ways to do a better job with your automatic testing, probably the QA people can help with this automation. Rapid release is not possible if you need to perform long (days perhaps) manual regression testing, scrum cannot give you rapid releases if you don't have an automated (or semi-automated, but very quick) way to ensure that something can go to production with the needed quality level.

Title: Quality Assurance (Testing) in Scrum


答:
Depends what you mean by debugging. In your approach debugging looks like just trying around until the bug is fixed.

From my point of view debugging is a little broader, i.e. reproducing the bug in an isolated scenario, evaluating the cause of the bug, fixing the bug, testing in a common scenario, etc. Iterations are possible ;)

To answer the question, debugging (like defined in the previous paragraph) is not a waste of time.

Title: Is debugging a waste of time?

Body:
I work on a lot of projects for fun, so I have the freedom to choose when I want to finish the project and am not constrained by deadlines.
Therefore, if I wanted to, I could follow this philosophy:

Whenever you hit a bug, don't debug. Instead, spend time learning about topics related to the bug from textbooks and work on other projects until one day you can come back to the bug and solve it instantly thanks to your piled up knowledge.

However, maybe the 'philosophy' is bad because

debugging is a skill that should be practiced so that when I need to finish projects by a deadline I will have acquired the skills necessary to debug quickly.

staring at lines of code and struggling to understand them when debugging makes you a much better programmer than writing new lines of code does.

debugging isn't a waste of time for some reason which I hope you'll tell me.


答:
For me a bug is when something doesn't work in a way I expect it to. Which usually means I don't understand how something work and in most cases I've seen it means that it is just a sign of something more serious going bad somewhere deeper. Which means I have to find why I see what I see. In some cases the result is "I don't even know how this worked before". Which is good - I just found a serious error by noticing that something is out of place.

So no, it is not a waste of time.

Title: Is debugging a waste of time?


答:
No. AR pattern does not violate SRP.

One needs to understand the use case of an AR pattern before using it in their application. Active Record Pattern has to be used where the domain logic isn't complex such as an app which involves just simple basic operations like CRUD. Reference: Patterns of Enterprise Application Architecture by Martin Fowler

AR pattern makes it simple the data access to and from the database as it ties the data access layer to the domain model.

Title: Doesn’t active record violate SRP and OCP?

Body:
I have watched the active record classes in our project grow into large, do-it-all classes. When you need anything about a user, for example, you should go to the Person class. While this makes perfect sense when you consider the domain, in reality, the Person class is a mishmash of lots and lots of functionality, which do get modified sometimes as the domain becomes clearer, which means both SRP and OCP are violated.

Is this one of the things that comes with the Active Record pattern, or are we doing it wrong?


问:
How does the product owner decide how successful a Sprint was?
Obviously if the product owner judges solely based on whether the committed stories were done, it wouldn't be good, because then the team will just commit to fewer stories next Sprint. On the other hand if the team made a tremendous job and overcame huge technical problems, but the commitments were not met, its also not good.

I think that some measure is needed though, because if there is no feedback from the product owner, the team doesn't know what to improve, if at all. So what,  in your opinion, are the criteria for the success of the Sprint?

答: The question contains the answer. There is no simplistic metric that will encapsulate all the realities of development down into a straight decision of success/failure. The whole point of having a sprint retrospective is for all concerned to reflect on whether the sprint was a success, given all the factors that came into play, and what could be improved in the next one.


答:
No, AR does not violate SRP.  Modeling a User is a single responsibility.  Mixing in persistence via AR does not make the User class responsible for persistence.  The AR framework is responsible for persistence.  Recording relationships between the User class and other classes still doesn't make the User class responsible for persistence.  Those relationships are facts about the user model.

If you add methods to the User class that fetch and store Users and Roles and other objects then you are violating SRP.  Those methods are not part of the User model, and belong in some service class.


答:
The whole point of a sprint is to complete tasks.

So from a purely "have we done everything" point of view, success is easy to define. You did, or you did not complete all the tasks.

However it is not as simple as that.

Stuff happens. People go off sick, technical problems arise, people are fallible and estimates might be wrong.

Title: How does the product owner decide how successful a Sprint was?

Body:
Obviously if the product owner judges solely based on whether the committed stories were done, it wouldn't be good, because then the team will just commit to fewer stories next Sprint. On the other hand if the team made a tremendous job and overcame huge technical problems, but the commitments were not met, its also not good.

I think that some measure is needed though, because if there is no feedback from the product owner, the team doesn't know what to improve, if at all. So what,  in your opinion, are the criteria for the success of the Sprint?


答:
Your customers will greatly appreciate it if they report a critical bug and you take the approach of just letting it sit there until suddenly a light goes on in your head and you come to the realisation just what exactly caused it several months later without ever having put any effort into actually analysing the problem...

Debugging isn't just mindlessly reading source code and hoping to spot the error. If the error were that obvious it shouldn't have ever made it into production in the first place.

Title: Is debugging a waste of time?


答:
Break down the task into subtask that takes maximum time t to deliver. (For exampe t=1day)

Do historical analysis to get a picture on how good your team estimated the time and try to improve.

Title: How do you deal with time estimates?


答:
Whenever you hit a bug, don't debug. Instead, spend time learning
  about topics related to the bug from textbooks and work on other
  projects until one day you can come back to the bug and solve it
  instantly thanks to your piled up knowledge.

You make the false assumption that people "write" bugs because of lack of knowledge. A lot of bugs are mistakes, and making false assumptions. And actually the debugging in itself is a learning experience which will develop you as programmer.

Yes, debugging is usefull because of:

3: you would never deliver a working product if you didn't.

Title: Is debugging a waste of time?


答:
Bugs generally happen because of a wrong assumption of how something works. Most of the time, the wrong assumption is about how your own code works. The algorithm you came up with for calculating something doesn't quite do what you think, especially in edge cases. You make an assumption about the input that doesn't actually hold. And so on.

In a few cases, the wrong assumption will be about something external. You misunderstood how initialization order during construction works (or maybe you got confused because it works differently in the language you're used to - just compare initialization of objects in Java, C# and C++). You thought the modulo operator never returns negative results.

In the latter case, learning additional things may help you, although stumbling across the right bit of knowledge is a big stroke of luck.

But most of the time, the additional knowledge you need is what precisely the code you wrote is doing. And learning that means studying the code, possibly watching it execute, and that's exactly what debugging is.

Title: Is debugging a waste of time?


答:
How far ahead you should estimate depends a lot on the needs of your business.

If the product owner wants to know when feature X could be expected, then you need an estimate of feature X and all features that come before it on the backlog.

If the product owner wants to know what he can probably release for the Christmas sales, you need to estimate the stories until you have enough to fill the sprints till then.

With that said, the estimates do not all need to be equally detailed and must not be cast in stone. The product backlog should contain approximately two sprints worth of stories that are fully detailed and where the team has a reasonable confidence in the estimations. Any stories that fall beyond that can do with less detail (more uncertainty) and estimates that are correspondingly less confident. As you go further in time, the stories are likely to become larger (more like epics) with according estimates. This isn't a problem, as those stories and their estimates will/should be revisited as they come nearer implementation and the knowledge about them grows.

The reason for having two sprints of fully estimated stories is to lessen the workload during the sprint planning (you don't have to estimate the stories as well) and to ensure that the team can pick up new work from the backlog if it turns out that they have time left at the end of the current sprint.

The reason for not casting estimates in stone is because they should only be used as an aid to the team to determine how much work they are committing to for a sprint. The only thing that should count at the end of the day is whether the team made good on their commitment.

Title: Estimation of your backlog


问:
Interfaces vs Base class
I'm strugging to know when to use a base class with Polymorphism or an interface.

Providing my object exposes DoThis() then I can't see why it matters if it's an interface of a base class.

Please consider the following

```<code>public void MyMethod()
{
    var myObject = new MyObject();
    myObject.DoThis();
}
</code>```

In regards to MyObject, I could have created it in 2 ways

Approach 1

```<code>public class MyObject : IMyInterface
{
    public void DoThis()
    {
        //logic
    }
}
</code>```

Approach 2

```<code>public class MyObject : MyBaseObject
{
    public override void DoThis()
    {
        //logic
    }
}
</code>```

From what I can see, both of these implementations achieve the same thing.

The issue could be my example is too simple/contrived but, is there a way to know when to use one approach over the other? In my example above, I would guess the answer is preference? I've not done any big projects before and so I'm guessing that one isn't as extendible but I don't know why I think that!

答:
A base class will allow you to share mutual functionality. In your example, there is not a huge difference. However imagine you have more than one method on your class.

```<code>public abstract class MyBaseClass
{
   public virtual void DoThat()
   {
      //do something cool
   }

   public abstract void DoThis();
}
</code>```

If you had implemented this on a concrete using an interface, not an abstract class, then you would have to have written the functionality for both methods.

If you use an abstract class or inherit from another class then you only need to write the code for DoThis().

DoThat() already does something cool, there is no reason to rewrite it on every concrete implementation. As it's virtual though, if you need to override it then you can.

Title: Interfaces vs Base class

Body:
A base class will allow you to share mutual functionality. In your example, there is not a huge difference. However imagine you have more than one method on your class.

public abstract class MyBaseClass
{
   public virtual void DoThat()
   {
      //do something cool
   }

   public abstract void DoThis();
}

If you had implemented this on a concrete using an interface, not an abstract class, then you would have to have written the functionality for both methods.

If you use an abstract class or inherit from another class then you only need to write the code for DoThis().

DoThat() already does something cool, there is no reason to rewrite it on every concrete implementation. As it's virtual though, if you need to override it then you can.


问:
Quoting for a project with closed source
I sit with a project that I need to quote, and until the job is awarded, I can only use "View source" to check, and ask a few questions about the system. That makes quoting outright impossible for me to do.

My question is: how do one go about quoting for such a project? What kind of questions should I ask? Do I decline to quote? Due to uncertainty, do I pad my quote?

答:
This is a normal problem with running as a freelancer - you have to take a risk and quote accordingly. Its the same for every business, that requirements come in and you have to estimate the cost of delivering them, sometimes you'll get it right, sometimes you'll get it wrong, the idea is that overall you'll make enough money to make it all worthwhile.

So, accept the risk and increase your quote accordingly.


答: Thoroughly document any assumptions you make in preparing the quote - say you quote ten days and it takes twenty due to circumstances you couldn't have foreseen, you don't want the client owning paying for ten days. Having the assumptions documented might even prompt further (hopefully useful) discussion.</p>

Title: Quoting for a project with closed source

Body:
I sit with a project that I need to quote, and until the job is awarded, I can only use "View source" to check, and ask a few questions about the system. That makes quoting outright impossible for me to do.

My question is: how do one go about quoting for such a project? What kind of questions should I ask? Do I decline to quote? Due to uncertainty, do I pad my quote?


答:
On the one hand there's the retrospective. All or most of the tasks defined in the retrospective must be ticked as done (the definition of done is defined by the team). The pending task(s) should be included in the retrospective of the next Sprint.

On the other hand there are the Sprint stories. If most of the stories are considered as done (that includes demos to the stakeholders, when relevant) when a Sprint is finished then I would consider the Sprint successful. If the majority of the stories are not completed then something is going wrong and the team must make sure that it will take actions to avoid that issue in the next Sprint.


答:
Three possible scenarios:

You inherit from a base class when you do want to extend and/or refine that base class' current behaviour.

You implement an interface when you do want your class to meet the contract specified by that interface.

Otherwise, you can perfectly do neither one nor the other.

In both three cases you end up with a class implementing the same methods. It's entirely a matter of semantics.

Title: Interfaces vs Base class

Body:
I'm strugging to know when to use a base class with Polymorphism or an interface.

Providing my object exposes DoThis() then I can't see why it matters if it's an interface of a base class.

Please consider the following

```<code>public void MyMethod()
{
    var myObject = new MyObject();
    myObject.DoThis();
}
</code>```

In regards to MyObject, I could have created it in 2 ways

Approach 1

```<code>public class MyObject : IMyInterface
{
    public void DoThis()
    {
        //logic
    }
}
</code>```

Approach 2

```<code>public class MyObject : MyBaseObject
{
    public override void DoThis()
    {
        //logic
    }
}
</code>```

From what I can see, both of these implementations achieve the same thing.

The issue could be my example is too simple/contrived but, is there a way to know when to use one approach over the other? In my example above, I would guess the answer is preference? I've not done any big projects before and so I'm guessing that one isn't as extendible but I don't know why I think that!


答: Developers or tech leads estimate the time for a project, depending on the features to be added. If this time is much more then you will have to discuss with them for reducing the feature/functionality. The estimates will also change depending on the developer to developer. A fresher can not complete the job in same time as an experience developer can complete. So such things should be taken into consideration. And developers do take all the time probably because there requirements are kept changing. </p>

Title: How do you deal with time estimates?


问:
Why is BigDecimal the best data type for currency?
I was reading this question and the accepted answer says that BigDecimal is the best type for representing currency values. I've also seen several other questions support the use of big decimal.

Why is BigDecimal the best type? I don't understand the relevance of arguments such as precise calculations or  people with large net worth. I am pretty sure that there are no currencies that round to the 10th decimal place, and almost no one has 8-bytes worth of money (if it were to store it as a long).

For taxes and other intermediary calculations, I can see how it is important to make sure you are using a proper type that doesn't round/truncate values prematurely, but that doesn't seem relevant to me either since an error of 0.0000000001 cents on the dollar does not seem that big to me.

It may be due to my lack of understanding of the importance of accuracy when it comes to financial statements, so perhaps someone can also clarify whether a millionth of a cent is significant as a final number.

答:
I am going to make an assumption here because you don't in your question.
Why is Bigdecimal the best? Because it's better then the alternatives.

Why is Bigdecimal better then Float?

Because in a float you can not precisely hold a value like decimal 0.1 .
The binary representation of decimal 0.1 would be : binary 0.00011001100110011001100110011001 which if you convert it back to decimal would be: 0.0999999998603016138.

Now I want to check a >= 0.1 condition and see it fail.........


问:
Do I continue developing an alternative existing solution, or am I wasting of time?
Almost 2 years ago I had need for a monitoring system, that monitored servers ping times, databases and various other metrics, but also things things like my email inboxes (for unread email), my game servers, webservers, and lots various other stuff. Nagios was the only system I'd used seriously, I liked it's architecture a lot (add a check with a python, bash, ruby, perl script, etc), but hated many things like the interface, the lack of decent remote check support and one of the biggest things was having to restart the service after any configuration change.

I Googled around a bit for other solutions, but as a developer, I didn't spend enough time Googling and found it easy to open up my IDE and start writing code for a new solution.

After a few hours I had something I thought was promising, had something functional in a few days and after a week or two I released The Upsilon Project (http://upsilon-project.co.uk). I've invested a few evenings and weekends over the last 2 years, but I've got a system that is totally perfect for me. It turned out better than I could have ever expected and I'm mostly happy with the technical functionality (respectable web interface, online configuration reloads, far better scheduler).

Now the next stage is pretty simple, it has been open source since the beginning (naturally), so I posted it around a few sites, once including reddit, and got some interesting feedback.

"Yet another monitoring solution"

"Ugh, it's Java and XML"

$X already does that (in particular, Sensu - http://sensuapp.org/ is eerily similar in architecture and objective)

So, I guess the last point is what bugged me the most, but it should not have come as a surprise, I didn't do my research I suppose because writing code is more fun! Now, I'm suppposed to be asking a question, so here it comes;

The Upsilon Project hasn't been a waste of time for me, because of this;

I've learnt a lot, mostly about the process of open sourcing a project (news, how difficult it can be to get interest, a community)

Stable, effective build pipelines are _ seriously hard_.

Effective, comprehensive documentation sucks to write.

Negative feedback really hurts, but it seems a good motivator to improve.

I've got a perfect system that works for me.

But it now could be a waste of time if I invest more into it;

Nobody is using my project, and many other solutions (Sensu in particular) are further along and have a community.

Any features now are surplus to my personal immediate requirements.

My contributions into other projects could help more, rather than further developing another tool.

My question to you is, do I continue with the Upsilon Project?

答:
The answer of the question whether you continue or not solely depends on your own definition of waste of time.

Reading

I've learnt a lot, mostly about the process of open sourcing a    project  (news, how difficult it can be to get interest, a community)

Stable,  effective build pipelines are _ seriously hard_.

Effective, comprehensive documentation sucks to write.

Negative feedback really hurts, but it seems a good motivator to improve.

I've got a perfect system that works for me.

Seems to me, that following your path and doing your project is totally fine - at least with yourself.


答:
In C#, there are two (major) things that differ between interfaces and abstract classes:

You can implement more than one interface, but only one class.

To be able to do that, you can't do some things in an interface that you can do on the base class - most commonly, implement any sort of default/common implementations.

One new caveat to this is that in .net 3.5 and later, you can create extension methods for interfaces. This can provide common or default behavior for instance methods, but not other members.

Most people will say to make an interface until you need the capabilities of an abstract base type. I urge a different approach:

Certainly there will be times when the functional differences will force your hand, but the choice also guides users in the use of your types. Use interfaces when you are conceptually describing a trait, or some property to be implemented. Something that can conceivably be implemented alongside other interfaces without violating the Single Responsibility Principle. Interfaces describe what something can do, not what something is. On the other side, abstract base classes should be used when you're defining the essential core of some thing. Inheritors are the abstract class and it would be wrong to be it and anything else.

This approach guides people to correctly using the code by communicating a better mental view of the design. Further, because it uses a better model, future changes are more likely to work nicely (how many times have you needed to add functionality to an interface, but couldn't because it was an interface?).

Title: Interfaces vs Base class


答:
In layman's words:

I beats me how on earth can someone separate the process of programming from the proccess of debugging.

If you write perfect programs the very first time you try, then you are Neo, the chosen one from Matrix trilogy, otherwise writing a program is a process of writing, testing and debugging.

Then, no, debugging is not a waste of time, it's a neccessity arised from the fact that you can't simply write a perfect program at the first try.

Title: Is debugging a waste of time?


答:
One could simply say that a successful Sprint is one that has met its goal :

Sprint Goal

The Sprint Goal is an objective set for the Sprint that can be met through the implementation of Product Backlog. It
  provides guidance to the Development Team on why it is building the
  Increment. It is created during the Sprint Planning meeting. The
  Sprint Goal gives the Development Team some flexibility regarding the
  functionality implemented within the Sprint. The selected Product
  Backlog items deliver one coherent function, which can be the Sprint
  Goal. The Sprint Goal can be any other coherence that causes the
  Development Team to work together rather than on separate initiatives.
  (From the Scrum Guide)

The Sprint Goal is a first level of guidance for the Product Owner and development team. But based on that goal, the Scrum team could also perfectly agree on more detailed success criteria for the coming sprint. Typical (usually implicit) ones include completing all the stories, making all acceptance tests pass, but there could also be more exogenous indicators : customer satisfaction rate after a demo, budget obtained, CEO adhesion, performance minimums reached, etc.

As others have said, I think the answer to your question is : there are no predefined universal sprint success metrics. Success criteria primarily depend on strategic business goals of the moment and should preferably be agreed upon before the sprint starts, through the definition of a Sprint Goal and/or more precise sub-objectives.


答:
In layman's words:

First option is better, because:

The part of SQL used for writing queries is declarative, not procedural, so intrinsically it's less complex than java, thus first option has less cyclomatic complexity.

Understanding SQL is a very common skill, so maintenance of SQL code is cheaper. A programmer may not know Java but there's a big chance he/she knows SQL.

This answer of mine (here) to a similar question elaborates on that.

This other answer to another similar question also supports that.


答:
Debugging and researching a bug are not very interchangeable.

Debugging is going through your code(using a debugger, running it while printing internal stuff, reviewing the code etc.) trying to find the part of your code that doesn't do what you meant it to do.

Researching is needed when you find a problem in a "black box" - a part of the code you can't probe, either because it's part of the language, or you don't have access to it's source code, or you simply lack the experience/knowledge/time to probe the source code by yourself. When you give that black box input you think is correct and it gives you incorrect output or side-effects, that means that either you don't use it properly or there is a bug in the component itself. At any rate - you need to research it in order to solve it.

Debugging can not be replaced with researching. Problems that need debugging are usually problems specific to your own code. If your function returns 2 instead of 3, you can't google the bug because even if you find someone else whose function return 2 instead of 3 it'll probably be because of different reasons. Even if your bug falls into a broader pattern that you can research, you'll often need to do some debugging first to find out which pattern it is, and by doing that you have probably already solved the bug.

Researching can not be replaced with debugging. If you find such a black box you're not going to just throw input at it randomly until you happen to make it work. Since the problem is with something external you can actually look it up. If a function from external library returns 2 instead of 3, and you find someone else on the internet who has the same problem, it's probably from the same reason, since you both use the same function.

Debugging and researching a bug are not very interchangeable. Which approach you should take(sometimes you'll need both!) depends on the bug at hand, not on some general rule decided beforehand.

Title: Is debugging a waste of time?


答:
Whenever you hit a bug, don't debug.

I'm not the original author so don't know for sure, but I don't believe they are arguing that you should never debug. I believe they are arguing against the tendency to immediately start debugging, as soon as you find a bug. I am guilty of this, sometimes, and it can be very tempting because sometimes it is a quick way to find the problem.

But debugging cannot replace a good understanding the code, and indeed, having that good understanding can help you debug the issue more quickly.

The skill, which only comes with experience of trying both, is understanding how much time to spend understanding the code, without a debugger, and when to just leap in with the debugger and "see what is actually going on"

Title: Is debugging a waste of time?


答:
All good answers here.
I would only add that bugs fall into two categories.

When you write a program, you have in mind, if not on paper, a notion of what you want it to do - a set of requirements.

When a program fails to meet its requirements, let's call that a type 1 bug.
Example: printing the wrong output.

When a program fails to meet any possible requirement, let's call that a type 2 bug.
Example: a crash or hang.

Either way, it's as important to know how to take bugs out as it is to put them in.

Title: Is debugging a waste of time?


答:
Nobody is using my project

To continue the project you need at least one user. If you are still using it for yourself, then you should not stop it. Did you try out your competitor (http://sensuapp.org/) and found it so much better that you now use their program instead of your own? Then you should stop the project.

Title: Do I continue developing an alternative existing solution, or am I wasting of time?

Body:
Almost 2 years ago I had need for a monitoring system, that monitored servers ping times, databases and various other metrics, but also things things like my email inboxes (for unread email), my game servers, webservers, and lots various other stuff. Nagios was the only system I'd used seriously, I liked it's architecture a lot (add a check with a python, bash, ruby, perl script, etc), but hated many things like the interface, the lack of decent remote check support and one of the biggest things was having to restart the service after any configuration change.

I Googled around a bit for other solutions, but as a developer, I didn't spend enough time Googling and found it easy to open up my IDE and start writing code for a new solution.

After a few hours I had something I thought was promising, had something functional in a few days and after a week or two I released The Upsilon Project (http://upsilon-project.co.uk). I've invested a few evenings and weekends over the last 2 years, but I've got a system that is totally perfect for me. It turned out better than I could have ever expected and I'm mostly happy with the technical functionality (respectable web interface, online configuration reloads, far better scheduler).

Now the next stage is pretty simple, it has been open source since the beginning (naturally), so I posted it around a few sites, once including reddit, and got some interesting feedback.

"Yet another monitoring solution"

"Ugh, it's Java and XML"

$X already does that (in particular, Sensu - http://sensuapp.org/ is eerily similar in architecture and objective)

So, I guess the last point is what bugged me the most, but it should not have come as a surprise, I didn't do my research I suppose because writing code is more fun! Now, I'm suppposed to be asking a question, so here it comes;

The Upsilon Project hasn't been a waste of time for me, because of this;

I've learnt a lot, mostly about the process of open sourcing a project (news, how difficult it can be to get interest, a community)

Stable, effective build pipelines are _ seriously hard_.

Effective, comprehensive documentation sucks to write.

Negative feedback really hurts, but it seems a good motivator to improve.

I've got a perfect system that works for me.

But it now could be a waste of time if I invest more into it;

Nobody is using my project, and many other solutions (Sensu in particular) are further along and have a community.

Any features now are surplus to my personal immediate requirements.

My contributions into other projects could help more, rather than further developing another tool.

My question to you is, do I continue with the Upsilon Project?


问:
A pattern to "atomically" update a pair of objects
Is there a standard pattern in OOP to kind of "atomically" update a pair of objects, like a pair of bank accounts on a transaction?

I would like to have somehow a single public method exposed that does it all at once, but can only come up with ways of doing it by making two calls of public methods to update objects separately.

I am currently experimenting with Racket, but i would appreciate examples in any language, or a description of a standard pattern.

Here is an example of what i have experimented in Ruby (with which i am more comfortable than with Racket).  I am not concerned with locking here, just with class interface.

class Account
  def initialize(total)
    @total = total
  end

  def total
    @total
  end

  def transfer_to(another, sum:)
    change_total_by(-sum)
    another.change_total_by(sum)
  end

  protected

    def change_total_by(sum)
      @total += sum
    end

end

a = Account.new(10)
b = Account.new(20)
a.transfer_to(b, sum: 5)
print "New a.total = #{ a.total },\nnew b.total = #{ b.total }"
```

This works using protected instead of private.

答:
I think i've found a satisfactory solution myself.  Here is a Ruby version:

class TransactionService
  def initialize
    @accounts = {}
  end

  def register_account(account_id, deposit_proc:, withdrawal_proc:)
    @accounts.store(account_id,
                    :deposit_proc    => deposit_proc,
                    :withdrawal_proc => withdrawal_proc)
  end

  def forget_account(account_id)
    @accounts.delete(account_id)
  end

  def transfer(sender_id:, receiver_id:, sum:)
    @accounts[sender_id  ][:withdrawal_proc][sum]
    @accounts[receiver_id][:deposit_proc   ][sum]
  end
end

class Account
  def initialize(total, transaction_service:)
    @total = total

    transaction_service.register_account(self.public_id,
        deposit_proc:    proc do |sum| change_total_by(sum)  end,
        withdrawal_proc: proc do |sum| change_total_by(-sum) end)
  end

  def total
    @total
  end

  def public_id
    self.object_id  # just for simplicity
  end

  private

    def change_total_by(sum)
      @total += sum
    end

end

ts = TransactionService.new
a = Account.new(10, transaction_service: ts)
b = Account.new(20, transaction_service: ts)

print "Initial a.total = #{ a.total },\n" \
      "initial b.total = #{ b.total }.\n" \
      "---\n"

ts.transfer(sender_id:   a.public_id,
            receiver_id: b.public_id,
            sum:         5)

print "New a.total = #{ a.total },\n" \
      "new b.total = #{ b.total }.\n"
```

I do not care about locking, but it can be implemented easily inside TransactionService#transfer.

Body:
I think i've found a satisfactory solution myself.  Here is a Ruby version:

class TransactionService
  def initialize
    @accounts = {}
  end

  def register_account(account_id, deposit_proc:, withdrawal_proc:)
    @accounts.store(account_id,
                    :deposit_proc    => deposit_proc,
                    :withdrawal_proc => withdrawal_proc)
  end

  def forget_account(account_id)
    @accounts.delete(account_id)
  end

  def transfer(sender_id:, receiver_id:, sum:)
    @accounts[sender_id  ][:withdrawal_proc][sum]
    @accounts[receiver_id][:deposit_proc   ][sum]
  end
end

class Account
  def initialize(total, transaction_service:)
    @total = total

    transaction_service.register_account(self.public_id,
        deposit_proc:    proc do |sum| change_total_by(sum)  end,
        withdrawal_proc: proc do |sum| change_total_by(-sum) end)
  end

  def total
    @total
  end

  def public_id
    self.object_id  # just for simplicity
  end

  private

    def change_total_by(sum)
      @total += sum
    end

end

ts = TransactionService.new
a = Account.new(10, transaction_service: ts)
b = Account.new(20, transaction_service: ts)

print "Initial a.total = #{ a.total },\n" \
      "initial b.total = #{ b.total }.\n" \
      "---\n"

ts.transfer(sender_id:   a.public_id,
            receiver_id: b.public_id,
            sum:         5)

print "New a.total = #{ a.total },\n" \
      "new b.total = #{ b.total }.\n"

I do not care about locking, but it can be implemented easily inside TransactionService#transfer.


问:
How to make it obvious that a function is being accessed from the outside?
This is a C specific question. I am trying to keep everything possible inside the translation unit boundaries, exposing only a few functions through the .h file. That is, I am giving static linkage to file-level objects.

Now, a couple of functions need to be called by other modules, but not directly. My module/file/translation unit subscribes to the other modules, passing a pointer to a function. Then, upon a specific event, the pointer is called with some arguments.

So I am wondering how to make it very obvious that those functions are called from some obscure location.

Should they be static or extern (and expose them in the .h) ?

Should I include some hint in the name of the functions?

Or is it enough to put a comment "called by X"?

答:
So I am wandering how to make it very obvious that those functions are called from some obscure location.

Define "obscure".

Methods should be exposed through well-defined "interfaces" and, as Shivan Dragon has already suggested, those "interfaces" are your .h files.  If you don't give another program the "right" header file then it can't call the method.

Should they be static or extern (and expose them in the .h) ?

static might be OK so long as you don't have any class[-like constructs] that contain instance data.

extern means you don't actually implement it at all; an implementation is "acquired" from elsewhere during the linking process.

Should I include some hint in the name of the functions?

Or is it enough to put a comment "called by X"?

Absolutely not.

Comments like this, no matter how well-meaning, are obsolete the moment you finish writing them.


问:
Code Duplication in Multi-Module Project
I've about seven modules arranged like so:

Service

Processing

Common

Account

Email

Scheduling

I try to make it my policy to restrict code to the module that actually uses it. Code that is shared by multiple projects (3+) is sent to common. However, there are a few classes that are only used by two projects. In my most recent example, both Account and Processing need some Image Processing done.

Is it a code smell two have the same classes found in two modules? Should I move duplicate code into common as soon as it it's used more than once?

答:
Anything that is used more than once should be put into a common location, if the usage is between different projects. Code duplication is the root of all evil and you can't be sure that a bug fixed in one location will get fixed in all the duplicate locations.

In terms of maintenance future developers could find it confusing to see two classes that are exactly the same in multiple locations.


答:
Its an interesting concept once you get past the emotional response many of these answers give.

Imagine the question said "never debug, instead write a test to reproduce the issue and fix the offending code from that". That's more ofd my understanding where the questioner was coming from.

Its a nice idea, but in the practical world, flawed because bugs don't often come from poor code, but poor data (yea, ok, it still counts as poor code because it doesn't handle the data given). Its the input that matters though. Code that works because it received expected data during testing is still working code, but when you deliver it the sheer complexity of a system says that you'll get very unexpected data - especially in circumstances where the data may be correct, but some other data elsewhere may cause a conflict. this is why you debug, you try to figure out why your 'working' code fails to work as expected.

A valid alternative is much logging, but if you put enough in, you usually end up narrowing the cause down which leaves you with a reduced debugging task - that still requires some debugging.

Title: Is debugging a waste of time?


答:
I really like the DRY principle from pragmatic programmers to describe this type of situation:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

What its the advantage of maintain two different representations of the same knowledge in a system?, IMMO this only can cause problems.

Title: Code Duplication in Multi-Module Project

Body:
I've about seven modules arranged like so:

Service

Processing

Common

Account

Email

Scheduling

I try to make it my policy to restrict code to the module that actually uses it. Code that is shared by multiple projects (3+) is sent to common. However, there are a few classes that are only used by two projects. In my most recent example, both Account and Processing need some Image Processing done.

Is it a code smell two have the same classes found in two modules? Should I move duplicate code into common as soon as it it's used more than once?


问:
Estimation of your backlog
How far in advance should you estimate stories in your backlog?

My concern is that estimates that are 6 months out will become out of date as you develop features in the current sprint. I thought that with agile you re-estimate your current sprint.

答:
It will change.  That's okay.

Your backlog will most likely become out of date during and after every single sprint.  This is why backlog grooming is important.  Your PO should see to this along with help from the team.

If your backlog is manageable, it's good practice to re-estimate the entirety of it during pre-planning / planning meetings, to give a more updated overview.  Along with a well estimated and established velocity, this should be enough to give the stakeholders a high-level overview of the project and it's future - as long as they accept the iterative nature of agile development.

Title: Estimation of your backlog


答:
If you take pride in your work, then:

the overhead of doing an database query every single time should disgust you

the idea of maintaining a massive hard-coded switch should horrify you

Most languages have support for collections and include things like hash maps, and this is likely to be very well optimised (and for languages that don't it's relatively trivial to implement anyway). This is what you should be using. For a collection of 10000 items it's extremely likely that you can find a value from your key faster than you can send a "do nothing" request to a database and receive a "nothing done" reply back.

The next question is, when you're creating the collection where does the data come from? This depends on the nature of your software - does it start once and handle many requests (like virtually everything that is sane), or is your software started from scratch every time (e.g. like the old CGI interface web servers used to use back when "internet connection" meant a dial-up modem; where every single "page fetch" would cause a massive amount of bloat starting a script interpreter, finding the script, letting the script initialise itself, etc).

For the first case you can do whatever is easiest for you to maintain. This could be loading the data for your collection from a "plain text" file or from the database. Performance doesn't really matter here because it only happens when your software is first started (which might be once every 200 days or something).

For the second case; you should ignore everything I've said above and do a database lookup every single time. Even though this should disgust you, anything you could do in your own software (starting/loading/initialising everything from scratch every single time) should disgust you even more.


问:
Can commented-out code be valuable documentation?

I wrote the following code:

if (boutique == null) {
    boutique = new Boutique();

    boutique.setSite(site);
    boutique.setUrlLogo(CmsProperties.URL_FLUX_BOUTIQUE+fluxBoutique.getLogo());
    boutique.setUrlBoutique(CmsProperties.URL_FLUX_BOUTIQUE+fluxBoutique.getUrl());
    boutique.setNom(fluxBoutique.getNom());
    boutique.setSelected(false);
    boutique.setIdWebSC(fluxBoutique.getId());
    boutique.setDateModification(new Date());

    boutiqueDao.persist(boutique);
} else {
    boutique.setSite(site);
    boutique.setUrlLogo(CmsProperties.URL_FLUX_BOUTIQUE+fluxBoutique.getLogo());
    boutique.setUrlBoutique(CmsProperties.URL_FLUX_BOUTIQUE+fluxBoutique.getUrl());
    boutique.setNom(fluxBoutique.getNom());
    //boutique.setSelected(false);
    boutique.setIdWebSC(fluxBoutique.getId());
    boutique.setDateModification(new Date());

    boutiqueDao.merge(boutique);
}
```

There is a commented-out line here. But I think it makes the code clearer, by making obvious what the difference is between if and else. The difference is even more noticeable with color highlighting .

Can commenting out code like this ever be a good idea?

答:
Commented-out code is not used by the application, so it needs to be accompanied by further comments stating why it is not being used. But within that context, there are situations where commented-out code can be useful.

What comes to my mind is a case where you solve a problem using a common and appealing approach, but then it turns out that the requirements of your actual problem are slightly different from that problem. Especially if your requirements turn out to require considerably more code, the temptation for maintainers to "optimize" the code using the old approach will likely be strong, but doing that will only bring the bug back. Keeping the "wrong" implementation around in the comments will help to dispel this, because you can use it to illustrate exactly why that approach is wrong in this situation.

This is not a situation that I can imagine occurring very often. Usually, it should be sufficient to explain things without including a sample "wrong" implementation. But I can imagine a case where that's not enough, so since the question is about whether it can be useful, yes, it can. Just not most of the time.


问:
How to teach your users/customers to send better error descriptions
I often have to deal with customers or users which are reporting errors in applications.
Most of the time their content is something useless as

ERROR!!!

x does not work

without much more information.

For resolving the issue I have to request every single detail of them, which often is more time consuming than fixing the issue itself. Other send information in formats which are not ideal, like screenshots (of data records, not of errors) although they could send a link (we have access to the systems) and so on.

How do you tell your users/customers to describe the problems with more details so that the whole process could be easier for both sides?

edit

This question is more about the social skills, than how to achieve programmatic collection of logs and error information. I'm aware of the fact that this should be part of good software design.

答:
The easiest way is to use a tool that can "understand" what actually the client wants. There are many tools, but maybe the best is Usersnap.
See this story here.</p>


问:
Extension method naming convention
We are using some utility methods in our company to simplify programming.

So we have following string extension:

```<code>public static bool IsNoE(this string s)
{
    return string.IsNullOrEmpty(s);
}
</code>```

This is just for convenience and the intention of this question is not to discuss the sense or senseless of such methods (maintaining, ...)

The question is about the naming.

Some people think the method should be named in this way:

```<code>public static bool IsNullOrEmpty(this string s)
{
    return string.IsNullOrEmpty(s);
}
</code>```

The argument for the first naming is:

It would not make sense to make extensions if they are not shorter to write.

The argument for the second naming is:

The only reason to add such extensions is just to support programming flow. (Writing a variable and then set the cursor back to the start to surround the variable with string.IsNull)

So why should I prefer one version over the other? Are there any naming conventions we can refer to?

答:
The first naming is just plainly wrong. Want a proof? What does the next piece of code do?

```<code>if (this.ah == PcX.Def)
{
    this.Z.SecN.Coll();
}
</code>```

The second naming is ok. It's explicit enough, but not too long. It's the one which is used by .NET Framework, so other developers won't be lost.

This being said, don't create aliases: you create additional code which has to be tested and maintained, while it doesn't bring anything useful to the project.

Title: Extension method naming convention

Body:
The first naming is just plainly wrong. Want a proof? What does the next piece of code do?

if (this.ah == PcX.Def)
{
    this.Z.SecN.Coll();
}

The second naming is ok. It's explicit enough, but not too long. It's the one which is used by .NET Framework, so other developers won't be lost.

This being said, don't create aliases: you create additional code which has to be tested and maintained, while it doesn't bring anything useful to the project.


答:
Seriously? Typing out method names is obsolete - if everyone had to type out System.Windows.Media.TextFormatting.TextSource.GetTextEffectCharacterIndexFromTextSourceCharacterIndex every time they used it, C# would be a dead language.

Fortunately the IDE does most of this for you, so length doesn't matter - clarity does however, so keep with the long version.

Any extension methods I create always go in their own namespace and are usually 'hungarianed' with 'Ext' at the end so I can clearly see its an extension (never want to spend time trying to figure out which class a method belongs to only to find it doesn't belong to any class! I figure it works well for interfaces (with an I prefix) and exceptions (with Exception suffix) to use this form for extensions.

Title: Extension method naming convention

Body:
We are using some utility methods in our company to simplify programming.

So we have following string extension:

```<code>public static bool IsNoE(this string s)
{
    return string.IsNullOrEmpty(s);
}
</code>```

This is just for convenience and the intention of this question is not to discuss the sense or senseless of such methods (maintaining, ...)

The question is about the naming.

Some people think the method should be named in this way:

```<code>public static bool IsNullOrEmpty(this string s)
{
    return string.IsNullOrEmpty(s);
}
</code>```

The argument for the first naming is:

It would not make sense to make extensions if they are not shorter to write.

The argument for the second naming is:

The only reason to add such extensions is just to support programming flow. (Writing a variable and then set the cursor back to the start to surround the variable with string.IsNull)

So why should I prefer one version over the other? Are there any naming conventions we can refer to?


问:
Storing web app passwords so that they can be retrieved
Short version

My boss wants me to store user passwords for an ASP.NET Web Forms web app we're developing in clear text, so that a user with admin rights can click a button and get back the current passwords for the accounts she controls.

I don't want to do that, because I deeply care about the security and privacy of users of a web app I am involved with in whatever way.

What would be a good way to store the passwords in an encrypted form, that can still however be decrypted?

I can't count on users having an email address, so sending the user a link to reset the password is not an option.

Read the following for more context.

Some context

This app was written by individuals who have little clue as to how software should be written. Lots of duplicated code, risks for SQL injection everywhere, no unit tests whatsoever, one new connection gets instantiated and opened for each and every query... name a bad practice, you'll find it in this codebase.

The passwords are currently stored as a simple MD5 of the original string, which is weak and horrible and everything, but still a tiny bit better than clear text.

I just finished implementing a feature request where the admin I was talking about can click a button and have an account automatically created for each employee she manages, with a random password.
I cringe while writing this, but one of the requirements was to export the credentials in an Excel spreadsheet. Which I did.

This is bad in and of itself, but then my boss said "What if the user loses the spreadsheet? Users are dumb, you know. There needs to be a way to get the passwords back."

Bang.

Getting him to listen to people who know what they're talking about is not an option, sadly.

The obvious suggestion would be "GTFO", I know, but rest assured that it's something I'll do as soon as I possibly can.

Meanwhile, I need to cheat and pretend I store passwords in clear text, while I do things in the best way possible to protect my users' passwords.

EDIT

For some reason people answering are assuming I'm a girl so, just for the record, I would like to clarify that I'm a guy. Not that it should make any difference, but hey ;)

答:
If you must do this because you aren't being given an option, you might encrypt the passwords with a password that is not stored in the code or in the database.  Make the recovery 'by request' of the customer (they have to call you for it), and someone on your end would have to enter the password to re-generate the user/pass list.

Don't fret over the stupidity.  You pointed out the more secure procedures, your boss ignored them.  It probably wouldn't hurt to get your objections in writing (email) in case there's a problem and they try to blame you.


答:
I actually use NullOrEmpty (on strings) as well as eg. JoinWith (an alias for String.Join).

The argument for the first naming is:

It would not make sense to make extensions if they are not shorter to write

Extension methods are shorter to write even if you do keep the original name, because you don't need to refer to the String class explicitly.

```<code>String.IsNullOrEmpty(foo)
foo.IsNullOrEmpty()
</code>```

Isn't it shorter?

Or in my case:

```<code>foo.NullOrEmpty()
</code>```

I find the extension method syntax even more handy for testing whether a string is not null nor empty.

Compare:

```<code>if (!String.IsNullOrEmpty(foo)) // double negation and not very readable, it's easy to miss the "!"
</code>```

Versus:

```<code>if (foo.NotEmpty())
</code>```

Having said that, I am 100% against cryptic naming such as IsNoE.

Title: Extension method naming convention

Body:
I actually use NullOrEmpty (on strings) as well as eg. JoinWith (an alias for String.Join).

The argument for the first naming is:

It would not make sense to make extensions if they are not shorter to write

Extension methods are shorter to write even if you do keep the original name, because you don't need to refer to the String class explicitly.

String.IsNullOrEmpty(foo)
foo.IsNullOrEmpty()

Isn't it shorter?

Or in my case:

foo.NullOrEmpty()

I find the extension method syntax even more handy for testing whether a string is not null nor empty.

Compare:

if (!String.IsNullOrEmpty(foo)) // double negation and not very readable, it's easy to miss the "!"

Versus:

if (foo.NotEmpty())

Having said that, I am 100% against cryptic naming such as IsNoE.