Computer Programming in short stated as Programming is widespread procedure which directs through an innovative inception of a computational trouble to executable programs. It includes tasks like examining, understanding, and broadly cracking these issues ensuing in an algorithm, authentication of wants of the algorithm compromising its accuracy and its resource utilization, execution of the algorithm in a aimed encoding language, testing, sorting out, and sustaining the source code, operation of the build system and administration of imitative object like machine code related to programs of system (Balagurus
Differences between Procedural and Object Oriented Programming
Procedural Oriented Programming is an accession targeting on creation and instructing actions or a chunk of code observing in mind to complete a definite task. The highlights of this accession are: - Utilizing the Procedures, Continuance of Procedures and chipping in universal data. On the other hand Object-oriented programming is a programming language form planned about "objects" rather than "actions" and data rather than logic.
Characteristics of Object Oriented Programming
Encapsulation: - Encapsulation is process to confine data and making it secure and protected from external edges. This is achieved by combining data and functions together as a bundle. It is made possible by declaring functions and classes in programs, especially in C++.
Inheritance: - It is a methodology through which a class can be imitative by a foundation class compromising every character of foundation class along with its own. It assists in enhancing reusability of code.
Polymorphism: - It is the capability to be present in varying states. For an illustration an operator could be overloaded to add integer or float numbers. Polymorphism permits a sending object to correspond with unrelated objects in an invariable mode without being concerned about the various diverse implementations of a message.
Abstraction: - It assists in symbolizing data at an especially intangible stage not including any information.
Difference between Composition and Aggregation
Aggregation is a unique instance of association. A directive association among objects, in situation where an object “has-a” an added object, then an aggregation exist among them. Route among them is précised which object compromises the other object. Aggregation is often stated as “Has-a” relationship.
DESIGNING OBJECT ORIENTED PROGRAMMING SOLUTION
An object oriented Model is a modelling theory primarily utilized in field of computer programming. A Class can be stated as group of data and the action which can be executed on that data. Subclasses are alike to the classes through which they are imitated, however they could possess varying characteristics or extra manners. The parent/child class concept is illustrated by the characteristic of Inheritance in Object Oriented Programming. An example shown below illustrates the parent/child concept.
TESTING OBJECT ORIENTED PROGRAMMING SOLUTION
Critical Review and Test
Critical Review could be stated as writing an action which allows a programmer to precise and examine a bunch of code. Here we have evaluated the source code for the particular program written to develop a class named Car and also its Parent classes and we have thoroughly reviewed it.
Testing the program is necessary to check whether the program is properly executing or not. It can be done in few manners which are stated below: -
What will occur if certain object is removed? What happens if certain bunch of code is altered? What will happen if certain function is modified? Various test cases could be prepared to check the validity of the program and its proper execution.
Test case can also be produced to validate a program or a software design. In precise Test Cases are the executions of a test case plan which assists the software tester to become aware of shortcoming in the program or the software being tested? It should be the major aim of any test case or group of test cases. When any developer scripts a test case, two kinds of cases are taken into consideration, positive test cases and negative test cases.
Positive test cases are such which perform the pleased path in the application and assure that the contented path is functioning very well. Negative test cases as the name proposes are disparaging test cases which are documented with various out of world thoughts to shatter the arrangement.
Analyse Actual Test Result against Expected Results
The actual test result has shown the display of object values which were initialized in the given code of program. The expected results were as same as the results which are being got after the execution of the program. By evaluation we got to know that the results are similar and we are able to get the proper results. Comparative refers to such a state where output is checked by entering different types of input and analyzing the output. Different sets of inputs are submitted and validation is carried out whether the actual result is being obtained or is the program producing errors in results. This leads to an error free program and the tester is even satisfied with the performance of program or application.
In the above project development of a program using object oriented programming is carried out, also impression has be laid on features of object oriented programming. In this project coding of the program has been carried out in C. Also the process of testing and documentation has been stated and its effectiveness is shown.
- Armstrong, DJ 2006. ‘The Quarks of Object-Oriented Development’, Communications of the ACM 49 (2): 123–128. Available from [http://agp.hx0.ru/oop/quarks.pdf].
- Balagurusamy, 2007. Object Oriented Program-Msbte, Tata McGraw-Hill Education, India.
- Farrell, J 2008, Object Oriented Programming Using C++, Cengage learning, Belmont, CA.