Posts

Showing posts with the label Week 5

Week 5 to 8 - Learning with MCR Codes

Image
My experience with  @MCRcodes   as a Quality Assurance Tester.  This is an evening part-time coding boot camp based in central Manchester which runs for 24 weeks, from February 2018 to July 2018. Week 5 (March 2018) - Just the end of last week, I have received feedback on my assignments with lots of pointers to becoming a better coder. One of the suggestion was to use an extension on my code editor ESLinter. In the first session, Joe helped me set this extension up and it is brilliant. Why haven't I installed this years ago? Lecture wise, we have moved on to lots of theory behind coding. This knowledge will make our employable stronger and a stronger knowledgeable programmer. Session 1 -  Object Oriented Programming &  SOLID Object Oriented Design Session 2 -  Test Doubles & jest.fn() Week 6 - Continued with last week Object-Oriented Programming exercise, finally understanding the benefits of creating a good code design. Also...

Week 5 - Session 2 - Test Doubles & jest.fn()

Image
blog image source A unit test should test one piece of functionality only, where the code will almost always interact with other objects and functions, we need to isolate our System Under Test (SUT) from external code. Isolation is important because; don’t want to indirectly test dependencies, broken dependencies could lead to false negatives in tests, dependencies may have side-effects, and helps us write SOLID code. This is where test double comes in. A test double is an object that can stand in for a real object in a test (think stunt doubles), or where you replace a production object for testing purposes. Common types of Test Doubles: Stubs: mock with some pre-programmed behaviour, object with given properties, function with given return value. Mocks: passed into a function and used to make an assertion in the test. Spies: record interactions with other objects, test if a function has been called (how many times and with what parameters), useful for testing fun...

Week 5 - Session 1 - SOLID Object Oriented Design

Image
In object-oriented computer programming, the term SOLID is an acronym for five design principles intended to make software designs more understandable, flexible and maintainable. S ingle responsibility principle  O pen/closed principle  L iskov substitution principle  I nterface segregation principle  D ependency inversion principle The first five principles of Object Oriented Design with JavaScript -  https://medium.com/@cramirez92/s-o-l-i-d-the-first-5-priciples-of-object-oriented-design-with-javascript-790f6ac9b9fa SOLID cheatsheet -  https://www.monterail.com/hubfs/PDF%20content/SOLID_cheatsheet.pdf

Week 5 - Session 1 - Object Oriented Programming

Image
blog image source OOP (Object Oriented Programming), can be defined as a programming technique based on objects, instead of just functions and procedures. Object Oriented Programming binds data and instructions for processing the data together into an object that can be used within a program or in other programs. Examples of  Object Oriented  languages include Java, Ruby, Python, PHP. JavaScript is a multi-paradigm language, most  Object Oriented  languages are class-based where  JavaScript  is prototype-based.  Advantages of OOP can be from various aspects: Code Reuse: Object Oriented Programming enables the reuse of code from one program into another program through objects. Data Integrity: Through encapsulation, it becomes easier to achieve data integrity and consistency by validating data and restricting the user from directly accessing the data/data members. Simple-Complex Design: Object Oriented Programming allows a desi...