By "end case" I mean the following. In many mathematical formulae, there are situations where normal rules don't apply. For example, a formula that works on a series from 0 to n. If a division is involved, the "end case" is dealing with that one exception where you have a divide by zero condition. In other words, special handling is needed at the front end of the series. Another example is where the results of some formula are asymtotic, and you need to impart special rules towards the back end as rush towards that end. And sometimes, you can have a singularity in the middle. I remember one case were the basic formula was outputting a sine wave, but because of a phase shift, the first derivative was undefined at the point of the shift, so special code had to be in place to handle that one point. These types of exceptions are generally grouped together as the "end cases". It may be that in some of your research, or the research that you're supporting, such end cases exist, and if not handled properly, that's where programs fail.
There are lots of resources about software engineering practices. Without going into too much detail, they involve careful adherance to the software life cycle phases, including Analysis, Design, Implementation, Testing, Rollout, and Support. Complete each stage in order, backtracking as required, with proper documentation and as much user-involvement as you can get or stand. It's not necessarily a straight-line process and you may need make adjustments, and go back to a previous stage during the process. You don't start building a building by pouring concrete and laying bricks. You start by analysing the purpose and needs of the building, drawing up plans, revising the plans, and reviewing them with the customer, revising again, playing what-ifs (a cat 5 hurricane, or a level 8 earthquake), then revising the plans and reviewing until you think all the bases are covered, and all before you pour the first ounce of concrete. The same should be done before you write your first line of code. When you start writing the code, it's like pouring the concrete. You should completely understand what you're building before you start.
Granted, we don't live in a perfect world, and forces that we have no control over (the boss, the bean counter, the markets, and so forth) try to rush things along, and short-circuit the process. As professional software engineers, we need to approach the project, and these peoples from the perspective of a professional enginneer and do the job right. Not easy, and not always possible, but it's what we should studiously stive towards.
We can't expect other to take us seriously and treat us professionally unless we treat ourselves and approach our task from a professional perspective.
Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein