Skip to main content

Posts

Showing posts with the label Software Engineering

Unit Testing Critical Legacy Code

I once worked on a medical project which required intense Unit Testing in C#. A problem I encountered is that all of the critical sections of the code can't be accessed or required a massive amount of object dependencies. The dilemma I was in drove me to search for a new soluion. Good thing I found TypeMock Isolator. TypeMock Isolator is a mocking framework that can take control of function calls regardless if it is accessible or not such as privately declared functions and etc. This Framework is center-focused on white box testing legacy code; although, can be used for black box testing. Why use it? Code not Written using SOLID Principles Tested code is not following TDD(Test Driven Development) Testing legacy code Unrefactorable tested code Excellent for mission critical code. Mock Instantiation Using Typemock Isolator, object instantiations can be ignored. Ignore Constructor ClassToTest obj = Isolate.Fake.Instance<ClassToTest> (Members.CallOriginal, Cons...

How to Rename a Local Branch in Git?

Renaming a local branch in Git is quite simple. To rename a branch from another branch, use this: $ git branch -m <current-branch-name> <new-branch-name> On the other hand, if already in the current branch, use this: $ git branch -m <new-branch-name> -m specifies the move operation. Pretty much the same kind of operation you would use to rename file in terminal.

Accessing USB device Through terminal

Identify usb device with lsblk. In this case, the usb is sda1. We first need to mount this into /media $ sudo mkdir /media/usb $ sudo mount /dev/sda1 /media/usb After that, we can now access the contents of the usb device through /media/usb You can check it by doing: $ ls /media/usb

Setting Up Altera CPLD Development in Linux!

Here is a simple guide to setup your Linux machine to develop Altera's CPLD. Install 32 bit libraries: $ sudo dpkg --add-architecture i386 $ sudo apt-get update $ sudo apt-get install libxft2:i386 libxext6:i386 libncurses5:i386 Download Whole software from altera website. ( Version 15.1) Download IDE, ModelSim , and device here: Altera Download Link Make sure to include your desired CPLD board software in the download. Get the usb blaster working by setting up the permissions by following Intel's Instruction Page . This should get you started with everything.