Example.com: Always Use It for Testing

Testing with example.comBackground

I was looking over some software tests today and they had different testing addresses such as test.com or test@test.com. This got me to thinking, isn’t there a standard site or address that we should use for testing? It didn’t take me long to find my answer; example.com. More on that in a bit.

Security Concerns

A couple of thoughts that came up while thinking about this; where is my information going while testing with made up sites and what kind of data am I sending? From a security standpoint, using unknown sites for testing may reveal flaws, sensitive data or PII to parties that may not have the best intentions in mind. Let me throw a hypothetical out there. Suppose I am a party that sees an opportunity to purchase the domain name tester.com. My reason for purchasing such a domain is not for legitimate reasons but rather as a honey pot. With that honey pot, I harvest the information by pulling in emails that come to that domain. Once that information is in hand, they could sell it on the dark web. Thankfully, my honor is paramount to me so I will not do such a thing.

Real Life Examples

A quick search on whois found the following: test.com has a private registration in the United States. We don’t know who owns this site. The question here is what are their intentions for the data they gather? Registration for somewhere.com is private in Panama. Nowhere.com redirects to a media outlet in Germany that looks like a simple front site. The last update for this site? 2012. I’m not saying that this one is, but its suspicious in the very least. A web advertising agency owns the site Test-site.com. There is a potential that the owner of test@test-site.com may add emails gleaned from tests to spam lists. How would your clients feel about a sudden influx of spam?

Other Concerns

A less evil, but realistic concern using random sites is that some of these sites could be real and legit. Take, for example a company named Pinacle Associates; I have no idea if such a company exists and please don’t bombard them with emails. Tes Thompson is an SVP for Public Relations for this company. For emails, this company decided on the naming scheme of first name last initial. In this case, Tes’s email would be test@pinacle-associates.com; again, I don’t know if this exists, so please be kind and don’t spam it. Imagine the amount of mail she must get if a test team decided to use her email address for testing?

The Solution: Example Domains

So what is the solution then? Set aside for the very purposes of testing and documentation are Example.com, example.net, example.org and example.edu. The Internet Corporation for Assigned Names and Numbers or ICANN owns and manages these domains. These are the folks that give out and manage domain names.

Conclusion

So the moral of the story here is that you should always use one of the example domains. Using a domain such as example.com when testing software will help prevent inadvertently leaking PII data. Your company or client values their data and wants it kept secure.

… And Everything Under the Sun is in Tune

Enjoying the eclipse in style

Eclipse

Wow! What an event. The eclipse of 2017 turned out to be everything that it was hyped to be. As early ago as yesterday, it was still looking a little dubious whether or not we would be able to see it as we were forecasted to have mostly cloudy skies during the time of the eclipse. Would the weather hold true to its promise? As you can see, the forecast was once again wrong, although at the time of this writing, it is now mostly cloudy outside.

I worked to get setup for the eclipse and it was muggy and hot. I thought for sure that I would either be spending a good chunk of the eclipse inside and be outside for the 45 minutes or so before the eclipse but that turned out to not be the case.

Soon after the eclipse started, the temperature began to drop. I knew that this would be a possibility, but I don’t know if it was due to a front moving through or the eclipse itself causing the cool down, I’ll have to look into that later.

Eclipse shadows
Weird shadows

Halfway There

About halfway through the eclipse, there was a definite dimming of the sky. Strange shadows from the trees had the appearance of waves flowing over the ground. It was indeed a strange site. I suppose I should define weird. All the shadows of leaves seemed to have a crescent shape to them. It was this crescent shape and the movement of the shadows that caused them to look like water waves.

About twenty minutes before totality, nocturnal instincts of animals started to kick in. The crickets chirped, some other nocturnal bugs started crawled onto the patio. Thankfully, I did not see any snakes. Birds started returning to their nests. Thor went into bedtime mode and retired to his room.

Thor's eclipse glasses
Thor, not liking the glasses

The Darkside of the Moon

I am happy to report that my experiment of syncing Pink Floyd’s The Dark Side of the Moon seemed to be almost perfect. I did take video, but it did not turn out too well for a variety of reasons but the major one of which was that a train was going by at the time of totality. Other night animals started in the form of neighbors shooting off fireworks during totality.

While I did not see any stars, I did see at least one planet, I’m assuming it to be Jupiter. I began shooting away with

the camera at totality, I had just under 2 minutes. The best one I took is at the top of this article. I missed the ‘diamond ring’ image due to taking in the scenery with my own eyes, but I don’t regret it.

This has been billed as a once in a lifetime event, but I hope to get to Texas in 2024 for that one. Based on the cost of hotel rooms in Kearney ($7k+ if booked close to eclipse time) I may need to make reservations soon.

 

New Resolutions – Week 3

Old Resolutions: Bizzy Cold Brew CoffeeLast week for the resolutions series, I wrote about trying a cold brew coffee by Bizzy Coffee.

Last Week in the Resolutions series

Maybe I misread where it said that you could drink it cold but, bleh! I did not care for it cold. Since we are in the midst of a devil’s sauna, I did not care for it hot either. Perhaps, coffee will never be for me, if it is, it will be a winter drink. I think, however, that it will always be something I occasionally try.

I’ve still got some of this left that I need to get through so I got myself some French Vanilla flavoring to help me through it. That is not what is new this week. This is just an update to let everyone know that the coffee won’t go to waste.

This Week

This week in the resolutions series, we move away from caffeinated beverages into the world of snacks, oriental snacks to be precise.

New Resolutions: Kame Rice Crackers

Trying foods of other cultures is always fun to me, even if they are Americanized.

Kame Rice Crackers were calling my name in the small oriental food section of a local grocery store. They looked like something I may like so I picked them up. The crackers look healthy. They have only 90mg of sodium, 0g of saturated fat, 0g of sugar, 120 calories and 2g of protein per 16 crackers. They are also certified gluten-free and non-gmo verified, if your into that. I will let you know how it goes.

Thoughts on Removing Confederate Symbols

Removing Confederate SymbolsI used to think that removing confederate symbols was in some way destroying or rewriting history but then I though, “Huh, You know what we don’t see any? We don’t see swastika statues around; not even the Hindu, Buddhist, Jainist, nor the Native American swastika.” We also don’t see statues or displays of pentagrams around much anymore. We removed those for the most part and yet we still know what they were. We know the weight they carried through news, textbooks, history courses and online resources such as wikipedia.

Power in Symbols

Good or bad, there is power in symbols. A symbol doesn’t care what its intention originally was. People, groups and society in general assign power to objects until they become a battery to charge beliefs. These beliefs can be beliefs that benefit others (good beliefs) or beliefs that hurt others (bad beliefs).

The swastika was originally a religious symbol of many peoples the world over. In some areas of the world, it still is. It remains a sacred symbol of spiritual principles in Buddhism, Hinduism and Jainism. In the Western world, it was historically a symbol of auspiciousness and good luck. It was not until the 1930s when the Nazi regime came to power when its meaning changed.

The pentagram is now widely considered a symbol of ‘evil’ by many religions, including Christianity. The fact is that the pentagram was once a sacred Christian symbol. It represented the five wounds of Christ. Today it is considered a sacred symbol among the Wiccan religion.

The Bellamy Salute

We no longer perform the “Bellamy Salute” when saying the Pledge of Allegiance because of its similarity to the “Sieg Heil” of Nazi Germany. Civilians now remove their head cover and place their hands over hearts. Some stand with hands at their side when saying the Pledge or during the singing of our National Anthem. Military members perform a military salute during these activities.

How the Meaning of Symbols Changes Over Time

I bring up these historic examples because I want to demonstrate how a symbol can change over time. This directly relates to what is going on now. We are not erasing our history by removing monuments of generals and leaders. These people fought to leave the United States; to keep their economy, an economy which relied heavily on slavery, the way it was. Yes, they fought brave and strong for what they believed, but in the end, they were rebels. They wanted to break up the United States and create their own country with a major chunk of the pieces. Today we would call that treason.

A Reason for Removing Confederate Symbols

Statues and flags of the confederacy have become magnets for people of hate. People like the white supremacist who gathered in Virginia for a white pride rally. These symbols have been growing in strength in the last few years and not in a good way. Perhaps, like the swastika and the pentagram, we should abandon these symbols as well. We should not abandon them through violence or vandalism, but through a legal process. Lets let the majority agree on what they symbolize and what should be done with them. Perhaps removing confederate symbols is the appropriate thing to do. They are not serving anyone any good anymore; they are only bringing trouble.

Happy Anniversary to Me

Rural Conference CenterHappy Anniversary

Today is my six year work anniversary with Xpanxion. With the exception of about a year or so when I was sick and then recovering from pancreatitis, it has been a very enjoyable experience. Even when I was recovering, I was enjoying learning new things. It was these things that I could apply to my work. Among the things I am most proud of is my continued work on an internal application I have developed to handle internal employee reviews. I have learned so much about software development working on that project than you can learn reading textbooks for a class.

The Future

Now our company is at a turning point. Not a bad one, mind you, the future looks very bright for Xpanxion. We are building a multi-million dollar rural conference center in my city of Kearney that will be state of the art. Our client list is growing almost weekly, we are in a good place. We grow not because we advertise or buy clients, we grow because our reputation grows. Our quality and work-force both here and overseas is incomparable to any other company like ours.

I just wanted to take a moment to reflect on my time with Xpanxion. I admit my bias but of all the careers out there, Xpanxion is the best.

PHPUnit – Unit Testing with PHP

Unit Testing
Unit Testing

In modern software development, unit testing can no longer be an ignored activity, especially for object oriented programming (OOP). I have been coding in PHP for several years now. I thought I’d share my thoughts on unit testing in PHP with you.

Unit Testing in PHP

OOP has so many advantages over procedural programming and unit testing is one of them. I’m not saying that unit testing can’t be done with procedural styles, but it has a much better use case in OOP programming. I am not going to get into the nuts and bolts of setting up PHPUnit for your PHP project, but JetBrains, the folks behind my favorite IDE for PHP, have an excellent article about setting up PHPUnit for PhpStorm. It can be found here.

Once PHPUnit is set up, writing tests is easy. Just plug in what you want to send to a method and tell PHPUnit what you expect the results to be.

Skeleton Framework

Here is a basic skeleton framework for writing tests.

 

<?php
/**
 * Created by PhpStorm.
 * User: aaron
 * Date: 8/13/17
 * Time: 12:03 PM
 */

require '../lib/Utilities/Utilities.php';

class UtilitiesTest extends PHPUnit_Framework_TestCase {


/* ** Test Initialization ** */

private $utilities;

protected function setUp()
{
  $this->utilities = new Utilities();
}

protected function tearDown()
{
  $this->utilities = NULL;
}

/* ** Tests ** */


/* ** addTwoNumbers() Tests ** */

public function test_addTwoNumbers() {

  $number1 = 2;
  $number2 = 3;

  $result = $this->utilities->addTwoNumbers($number1, $number2);

  $this->assertEquals(5, $result);

}

/* ** subtractTwoNumbers() Tests ** */

public function test_subtractTwoNumbers() {

  $number1 = 2;
  $number2 = 6;

  $result = $this->utilities->subtractTwoNumbers($number1, $number2);

  $this->assertEquals(-4, $result);

}


}

PHP Assertions

There are a whole slew of assertions built into PHPUnit, assertEquals() is just one of them. Assertions such as assertNull(), assertNotNull(), assertContains() are some of the most common ones used. For a complete list, check out the assertions link of the PHPUnit documentation.

See, that really is pretty simple. Of course, when writing unit tests, there is a danger for the mind to wander and think of ‘what if’ scenarios, especially if you come from a quality background such as a QA Analyst. Unit tests should cover the functionality of the component being tested and nothing else; that is what QA is for; they will find the functional defects, you just need to make sure your code works as expected. That is where the unit tests shine.

The Purpose of Unit Testing

This can’t be stressed enough, the primary purpose of unit tests are not to find defects, they just make sure that the components of code work as they should. Even though the unit tests will find a defect in the above examples if it shows that 2 + 3 = 4, that is not the purpose of the test as this will be found during functional testing. The purpose is just to make sure that the method works correctly; calculator examples are also the easiest examples to demonstrate code.

New Resolutions – Week 2

New Resolutions - Honest Tea

Resolutions from Last Week

Last week, on ‘New Resolutions’…

I wrote about my newfound love of tea and the new teas that I was trying. I tried the Honest Green Dragon Tea and the Honest Assam Black Tea. Both were actually really good. I said something about not liking green tea, but liking dragons; well, the dragons won. I was pleasantly surprised because even though there was a sweetness to it, there was not the over-the-top sweetness that turned me off of most green teas.

The Assam Black Tea was pretty much what I expected, a nice, full body black tea. Not much else to be said about it other than it was good, just as I expected.

New Resolutions - Bizzy CoffeeResolutions This Week

This week, as part of my resolutions series, I leave tea behind and try some coffee. I’ve never been able to get into coffee but people at work drink it like mad. I have tried regular office rot-gut coffee, nice coffee shop coffee of varying varieties and have never really been able to hold an interest in it. Maybe its because I don’t like hot drinks, I don’t know. I’ve never been able to get into coffee.

I am going to try it once again this week.

As I was wondering the tea aisle of the grocery store, I came across some organic, concentrated, cold brew coffee by Bizzy. So I said to myself, “Self, you should try this.” So I am. I am hoping that the not so hot drink will appeal to me a little more, but as I write this and am sipping on it, I think it could use a little bit of warmth to it. I’ll report back the final results next week. For now I am going to (try to) enjoy it.

That’s all for now.

 

Edited – Pink Floyd’s The Dark Side of the Moon timed to the August 21 eclipse

Edit: Start time changed to 12:15:20 PM.

Pink Floyd is one of my favorite bands. I have to admit that when I first heard about the total eclipse of August 21, 2017, The Dark Side of the Moon didn’t immediately pop into my head until just recently. I’m certain it is not a new idea to time TDSotM to the time of totality of the eclipse, but to me, this is something that is right at the top of my bucket list. I know, I’m strange.

The first thing I needed to do was to find out when the totality of the eclipse would occur where I live. Luckily the Eclipse 2017 website has that information readily available. My local time for totality is 12:57:30 PM.

The second thing I needed to do was to find the time to the apex of the song Eclipse on TDSotM. This sounds simple, but can be a little complicated depending on which version of the album you have and how its stored. For me, I have the album on iTunes from the 20th Anniversary Edition, so the time to the apex for me is 42:10. Using this time should get you in the right neighborhood for a pretty good coinciding time for the eclipse.

Finally, subtract the time 42:10 from the time of totality. Again, for me, this is 12:57:30 PM. If all goes right, the time for me to start playing TDSotM is at 12:15:20 PM. Over the next few days, I am going to do some testing to make sure this time works correctly but I think it will.

Good luck to all who plan on trying this.

What I’m Reading – The Magic of Thinking Big

So far, I am 25% done with this book by David J. Schwartz. Its not a bad book, full of reenforcing quotes and ideas that, if one took the time to think for a few moments in this fast-paced world, they would come to the same conclusion. I like books like these, because they serve as a condensed reminder of the importance of thinking big and setting goals higher than you otherwise would.

These ideas are timeless, going back to the age of the Greeks or before. They survived through the Middle Ages, thrived in the Renaissance, reemerged again in the Age of American Exceptionalism (note: I personally mark this period as the post WWII era to the 1960s). Its a pity that critical thinking and goal setting are not taught in public schools anymore.

I see so much promise in the generation coming of age and am optimistic about the future and the youth of that future, skills like the ones preached in this book will make the future generations unstoppably successful.

If you get a chance, check out this book. It has a lot of little nuggets of wisdom such as these:

  • “See what can be, not just what is.”
  • “Build castles, don’t dig graves!”
  • “To think confidently, act confidently.”

https://www.goodreads.com/book/show/23658680-the-magic-of-thinking-big

Simplifications and Improvements

“Simplicity is the art of knowing what to take away.”

I have removed the menu bar for now (until more features are added) and made it simpler to add recipes by clicking the “Quick Add Recipe” button.

Enjoy!


Active development continues and some exciting things are being worked on.

Current work:

– Support work such as documentation, automation tests, etc. This work will not be noticeable to the end users, but it serves to support active development to ensure a quality product.
– Enhanced recipe forms. This form will allow users to enter advanced recipe information such as separate ingredients, separate notes and other information.
– Account validation through email
– Message feed improvements
– Password reset options
– Basic image manipulation
– Recipe privacy for sharing recipes.

I hope to have many of these completed by the end of the month.