+ Start a Discussion

do I need to write test code for some simple SOQL code

Hi, I save the following code to the production in Eclipse, no test code included as I dont know how to do it.



public class sortedmilestones { public Id opportunityID {get; set;} List<Milestones__c> milestones; public List<Milestones__c> getmilestones(){ if(milestones == null){ milestones = [select Id, Name, Milestone__c, Stage__c, Verifiable_Outcome__c, Achieved__c, Date_Achieved__c, Milestone_Notes__c from Milestones__c where Opportunity__c =:opportunityID order by Name]; } return milestones; } }


 It seems like it is working properly.


My question is, is test code requried for this? What is the down side if there is no test code?