Jason Hart

Electrical engineering best practices for the Mac

Electrical engineering best practices for the Mac.

Creating a Test Log

Whenever I do any sort of testing or debugging, I like to keep a very accurate log of what I'm doing. I've found this to be a really good practice for a few reasons:

  1. This gives you a really nice record of events to go back over in case you forget if you tested something or how you tested it. In some ways, it can become a journal of what you did that day.
  2. It forces you to be very methodical about your testing procedure. You don't want to change two variables at a time when testing. A step-by-step log puts you in the mindset of doing one thing at a time.
  3. It slows you down and forces you to think. The act of writing down what you just did gives your brain some time to process what you just did.
  4. It gives you a way of looking back at things so that you can see at what step a problem came up. This is really useful in debugging software or system-level issues.

I have two ways of creating a test log. The first is completely unexciting and we've all been doing it since we were kids. Pen and paper. Or in my case, an Uni Kuru Toga mechanical pencil and a Moleskine Folio Hard Cover 8.25 x 11.75 notebook. Yes, I record test results with a pencil, but don't worry, I have a way of making things permanent. When I'm done with the notebook I rip it apart and put it through a scanner to keep a digital copy. I only use paper when the testing is particularly dirty and I know I would destroy a laptop in the field.

The second is my favorite and involves two really useful pieces of software: DayOne and TextExpander. DayOne is a beautiful journaling app that lets you sync journal entries with Dropbox and I've talked about TextExpander before. DayOne lets you add the current location and weather to any entry, which is perfect for keeping a log of testing.

I have a few TextExpander snippets that I use in order to quickly create my test log and all of them have to do with the date/time:

  • ddati will expand to the date and time in a nice format. It looks like this: 2014-10-15-11-50-10
  • chma will expand to the date and time and also a text phrase to record that I've made a change. It simply looks like this: 2014-10-15-11-50-40 CHANGE MADE:
  • reafch looks similar to chma except that the text phrase indicates that these are the results after a change was made. It looks like this: 2014-10-15-11-52-36 RESULT AFTER CHANGE:
  • ddano is also similar except that the text phrase indicates a thought I had or something to note. I use this if there is something interesting going on, but it isn't a result of a change that was made. It looks like this: 2014-10-15-11-53-59 NOTES:

And that's it. Just using those four snippets will help me to quickly create a nice test log. I start every line with one of these timestamp variants and it will generate a file that can be easily parsed later on. You should know that if you want to get the log file out of DayOne, you'll need to export it manually. If you know you'll always need to use the log file somewhere other than copying and pasting it into a larger document, you may want to just use a simple text file instead of DayOne.

TextExpander

I want to show you how I use TextExpander with the goal of showing you how you can save some time even if you don't write a lot of text.

TextExpander is a utility that runs in the background and looks at what I'm currently typing. If I type a short phrase that I've predefined in TextExpander, it will replace that phrase with something else. For instance, when I type oscope, it is replaced with oscilloscope automatically. Think about how many times you write oscilloscope in your test plan and that alone should be worth the price of the software.

TextExpander also allows for variables. So if I type ddate, I get today's date in the format I like (YYYY-MM-DD). This is especially helpful in naming files for easy sorting later on. You can also use the clipboard as a variable. So you can add the contents of the clipboard to a longer string of text. Or you can manipulate the contents of the clipboard to covert the case or remove all of the formatting.

TextExpander is great for software that is keyboard-driven as well. With Eagle if I want to copy a group of items, that is two commands (copy, then group). So I can either mouse over to the copy icon, click that, then mouse over to the group icon and click that. Or I can type copy%key:enter%group%key:enter%. Or I can use TextExpander and type cpgp and it will enter that string of keystrokes for me. Magic.

You can also ask TextExpander to give you pop-up windows to let you enter values on the fly. So if you wanted to draw a box using the rect(x,y) command, you could have TextExpander open a small window and ask for the x and y values to fill in. David Sparks has a great screencast about this feature.

TextExpander is availble for the Mac and iOS. It is a great tool for EE's even if you don't think you work with text that much.

You and Your Windows-based Coworkers

Keep in mind that not everyone shares your love of the Mac. If folks find it difficult to work with you because of added friction, you're not going to make any converts either. Here's just a few things to keep in mind when interacting with Windows users.

Keep Things Simple

If you can share files as plaintext, do that. You can be sure everyone will be able to open and edit a plaintext file.

Beware of File Conversion

If you have any deliverable documentation like an ICD or User's Manual resist the urge to write it using Pages and just export the finished work as a PDF. Inevitably, someone will want to make some edits later on and they'll be pretty miffed when they find out they can't.

You also want to avoid writing something in Pages and exporting it as a Word document. It might be alright for simple documents, but as soon as you throw your company's formatting into the mix I guarantee it won't export properly and things will look wonky.

Your best bet here is to use whatever program everyone has access to. Microsoft Office for OS X may not be very Apple-like, but at least you can be sure your docs will look the same everywhere.

Linking to Files

If you're sending someone a link to a file, remember to include both Linux and Windows link formats. The Windows format looks like "C:\path\to\file" and Linux format is "/path/to/file". And every time you have to reach your finger for that awkward "\" character and you want to mock your Windows counterparts, remember the next piece of advice:

Be Nice

This is more of a mindset than a tip, but in all seriousness, be kind. Electrical engineering is still primarily a Windows-based profession and you are the outlier. We all want to enjoy our work so you may have to put in the extra effort to reduce some friction. This may mean researching things for your IT department if they don't support Macs on the network. Or taking the extra time to preview a file on a Windows machine before sending it out for review. We're all on the same team and want to do the best work possible with the tools we like using.

If you take a moment to think about how others are going to interact with your work, then hopefully it will be as seamless as possible. The goal here is for people to forget that you're not on a Windows machine, although they may wonder why you don't join in when they gripe about their computer problems.

Running Windows programs on a Mac

Try as you may, there are just some times when you have to run a Windows-only program on your Mac. This is especially true in electrical engineering where there is a lot of really helpful software that may not run on OS X any time soon. There are a few ways that you can get around this obstacle.

  1. Boot Camp
  2. A virtual machine running Windows
  3. A VNC software suite and access to a computer running Windows

Boot Camp

Boot Camp is Apple's answer to the Windows-only software problem. It allows you to boot into Windows when you turn on or restart your Mac. It will look and feel just like you are running Windows on a PC. Boot Camp is included with OS X for free, but you will need your own licensed copy of Windows (XP, Vista, 7, or 8).

Pros: free if you own a copy of Windows; Windows has direct access to your Mac's hardware including USB drives, optical drives, microphone, etc.; no new software to learn.

Cons: you loose all of the great features that make Mac OS X such a joy; you have to reboot your Mac every time you want to run software on a different operating system, no shared files between Windows and Mac.

A virtual machine running Windows

Don't be put-off by the terminology, this is a great way to roll. A virtual machine allows you to run another operating system within your current OS. I use Parallels daily to run Internet Explorer or Visio without having to reboot my Mac. This lets you run Windows programs and Mac programs side by side, almost seamlessly.

Pros: no need to reboot; you can share files between Windows and Mac; Windows has access to your Mac's hardware.

Cons: virtual machine software has a cost; running the VM can be a drain on your battery;

A VNC software suite and access to a computer running Windows

This last option is probably the most difficult to setup and maintain, but may be good if you only need Windows on the rarest of occasions. You install a VNC server on the Windows PC and a VNC client on your Mac. RealVNC is a good option. Then you open the client on your Mac and remotely connect to the Windows computer.

Pros: cheap if you have access to a Windows computer; doesn't bog down your Mac.

Cons: you must have a network connection to the Windows computer; difficult to share files; takes up a lot of network bandwidth; unreliable.

These are the options that I know of. I'll be talking more about option 2 since that is the setup I use personally. The decision likely boils down to how often you need to run Windows and whether you need to share files between Windows and Mac.