Wednesday, May 25, 2016

To Do App - Finished

So the last few days I've been working hard to get a finished To Do web app finished. Its not like I have to finish it by a certain date, but I really wanted to finish it before I started my new position. And I am happy to say that I have succeed on the most part, but there are a few things that I still want to do. Let me explain in the following screenshots:


The screenshot above is of my home page, its really similar to my mockup that I created a few days ago. The biggest difference is that I added tabs to the task list. One tab shows tasks that are outstanding, and the other shows the tasks that have been marked as completed.


The reason I added the separate tabs is that I didn't really know what to do with the tasks that were marked as done. I didn't want to delete them from the database, and I didn't want to leave them in the same list as the outstanding tasks. I decided that having a list of completed tasks would be the best thing to do.


Adding a new task also didn't work out as I wanted it to. In my mockup, I had planned to use a modal that would keep the user in the same page, but I couldn't figure out how to do it that way. The only way I could add a new item was to go to a dedicated page for adding a task, and then take the user back to the homepage with the new task.

On the home page, each task has three buttons that allows the user to perform an action on the task that it belongs to: Edit, Details, & Delete. Delete is self explanatory, it simply deletes the task from the SQL database and by extension from the list.


Edit and details are almost the same, so I will cover them at once. Edit allows you to go into the task and update any information for it. For example: if you need to add notes or change the due date you can do that in the edit page. The you save it and it updates in the database as well as on the list. This is also the page to mark the task as "Done" when you have completed the task. I was trying to figure out how to do it from the home page, but I couldn't.

The details page is exactly like the edit page, but its a "read-only" version and you can't change any of the information, you have to go to the edit page to do so.


And finally here is my database that I set up on MySQL. Its a really simple table with only 6 columns. The book that I got on SQL really helped me out on how I should set up the table. I am not done with the book yet, I think I am only a 1/4 of the way done with the book, but I already know way more than I did a week ago about SQL.

I will try to keep working on the app if I have time to make it better and work from a single page, but for now I am done. I am super nervous at the moment since I start my new job in the morning (its almost 1 AM), and I don't really know what it will be like. But I am ready and I hope that I leave a good impression so I can stay on the team after the 90 day trail ends. That's all for now, thanks for reading!

Sunday, May 22, 2016

To Do App - Mockup

Since I don't have any experience with web development, I have been looking into how to build my to do app using Microsoft's MVC framework. For now I have an idea of how I want the final thing to look like, here are a couple of images of the mockup I made:


This is the home page, where it will show the list of outstanding tasks with a few buttons for actions on each task.


To add a new task, I want to create a modal that would allow the user to type in all the important information and then add it to the list.

As I mentioned before, this is just a mockup, so none of it is actually being persisted on a SQL database. I don't really know how I'm going to do all this, but I am still working on it. All that you see up there is just some tweaking that I made to the sample project and some simple UI updates using Bootstrap.

That's all for now, thanks for reading!

Friday, May 20, 2016

Prepping for the New Job

So since I got the new good news a couple days ago about my new position next week, I have started to try and learn more in the areas that I didn't do well during the interview.

Over the next few days I plan to learn as much as I can about SQL and websites using the MVC framework.

The first is obvious, like I've said before, my knowledge of SQL is very limited. I know that I won't become a SQL master over the weekend, but I hope to know at least the basics. My job actually bought me a book that I can use called Teach Yourself SQL in 10 Minutes. There are plenty of free resources available online to help me, but my manger thought this would be a better option so they got me the book for free. I really love working there.

I will also try to build a simple website using ASP.NET and the MVC framework because that is usually what new developers do in the company. For the first few weeks, new developers have to build a simple To Do List web app. Basically its an app that should allow a user to keep track of tasks, a user should be able to: Create, Read, Update, and Delete tasks. These tasks should be persisted to a database of some kind. Normally they use a NoSQL data base like RavenDB, but since I am learning SQL I will use MySQL DB for this web app. I don't know a single thing about web development, but I will try my best.

That's all for now, thanks for reading!

Wednesday, May 18, 2016

So I Got the Job...

So a couple of days ago I posted about an interview I had at work for a Jr QA Engineer position, and by what I can only call luck... I got the job! I start next week after my current sprint is over at work.

Basically what happened is that a couple of other people had applied for the position, but on the day of their interview (yesterday), they canceled since they had accepted job offers somewhere else. So I guess by default I got it?

I know that I shouldn't be happy that I got the position by pure luck, but I am truly grateful that they decided to give me an opportunity since they could have easily just kept looking for someone else. Since there was a lot of stuff I didn't know about databases in general, I am actually joining the team as a temp. If I do well in the first 90 days, then I get to stay on the team. I am going to give it my all and try to learn as much as possible in this position. I hope that with this job I will get the required experience needed and one day be a full fledged QA Engineer one day.

Needless to say, I am super happy right now and I can't wait for this next challenge. I am also super nervous, but I will just face it as it comes.

That's all for now, thanks for reading!

Monday, May 16, 2016

Jr QA Engineer Interview

So today I had an interview for a Jr QA Engineer at my work place, and since it was my first engineering interview I didn't really know what to expect. And I have to say that I was not ready for some of the stuff that they were going to ask me.

The interview started with some SQL and database questions. I had tried to study some basic SQL stuff over the weekend, but I didn't think that they were going to ask me anything about it, I figured they would focus more on my C# experience. Since my experience with SQL and databases is very limited, I think its safe to say that I failed this part of the interview.

Next they moved on to some OOP (Object Oriented Programming) questions and I'm happy to say that I did much better in this sections. They asked me a few different questions on what inheritance was, when would you implement inheritance, and a few other questions. I struggled a bit on explaining myself, but I got through it.

Next was probably my favorite part, actual coding on a white board. They asked me how I would write a function that would calculate the factorial of a given number. This part I spent probably a couple of minutes since it was really straight forward. This is the code I wrote:

public static int Factorial(int n)
{
    int result = 1;

    for (int i = n; i > 0; i--)
        result = result * i;

    return result;
}

They looked at the code, and told me it was good. Then they asked me to rewrite the function using recursion. I struggled a bit on this part, I had trouble trying to put into code what I had already done in a different way. They gave me a hint saying that 5! = 5 * 4! and that was all I needed. Here is the code I wrote:

public static int FactorialRecursive(int n)
{
    int current = n;

    if (n == 1)
        return n;

    int next = FactorialRecursive(n - 1);

    return current * next;
}

Overall I think I did much better in the second part of the interview than the first. I am not too hopeful on getting the position, but at least now I know what I need to work on and I am ready for the future. That is all for now, thanks for reading!

Wednesday, May 11, 2016

Learning Selenium WebDriver

So as you can probably tell my my recent blog posts, I have been trying to get more into coding and learning different things that will help me become a developer in the future.

Since I am a QA Specialist, I've heard the buzzwords "selenium" and "automated test" thrown around the office, but I didn't really know what any of those were. So I decided to start looking into it and try to understand how Selenium works and how to make automated test.

After spending sometime looking at some videos on Pluralsight, I got the basic idea that basically you can use a programming language like C# and write a "script" on what you would like to do in a website. I did some basic examples, but I didn't really think about it until yesterday.

In my current project at work, we are currently working on migrating our existing database from RavenDB to MartenDB. There are many documents that we have saved in the Raven database, and we are going to migrate each type of document. But in order to test it correctly, we were trying to find a simple way that would allows us to generate a lot of activity on the site, like customer's trying to reset passwords and see if it would affect the migration.

I had the idea that I could write a Selenium script that would do this for us on the site. Here is what I came up with:

using System;
using System.Diagnostics;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;

namespace SeleniumTest
{
    class GenerateTokens
    {
        public static void Main()
        {
            Generator();
            Environment.Exit(1);
        }

        private static void Generator()
        {
            IWebDriver driver = new ChromeDriver(@"C:\Libraries\");
            driver.Url = "some-site.com";

            Debug.Assert(driver.PageSource.Contains("A message has been sent with directions on how to reset your password.") == false);

            for (int counter = 0; counter < 100; counter++)
            {
                driver.FindElement(By.Id("forgot-link")).Click();

                IWebElement email = driver.FindElement(By.Name("Email"));
                email.SendKeys("some-email@some-domain.com");

                driver.FindElement(By.ClassName("btn-primary")).Click();

                driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(2));

                Debug.Assert(driver.PageSource.Contains("A message has been sent with directions on how to reset your password.") == true);
            }

            driver.Quit();
        }
    }
}

This script would essentially go to a site and go through the steps a customer would take to recover their password on their account. The script would repeat it 100 times (but it can be increased if we wanted) and we wouldn't have to worry about doing it ourselves manually. The downside to this script, is that it would perform the same action for the same account/email address provided. I was thinking of maybe modifying this script to read a text file that contained a lot of different email address that it would just input on the site.

I don't think this script will actually get used at work since I am not a QA Engineer, and I think they might have a better approach at doing this with some internal tool, but I thought that it was interesting how easy this was to write.

Anyways, that's all for now. Thanks for reading!

Tuesday, May 10, 2016

The End of Disney Infinity

As most people know by now, Disney Infinity has come an end... by the sound of things is was kind of a surprise to everyone that Disney decided to end the production of the game.

I haven't worked at Avalanche since September of last year, so I don't really know what went down but all my friends that still worked there are really shocked at the news. I just hope that everyone there is able to find another position at other studios soon.

I was only a game ester in my short time at Avalanche, but I loved my time there and it thanks to them that I am now a software tester.

That's all for now, thanks for reading!

Sunday, May 8, 2016

Caesar Cipher in C#

So I was talking to a co-worker the other day and the topic of a Caesar Cipher came up in our conversation. We talked about how it wouldn't be too hard to code something quick that would be able to "encrypt" some text.

So I was kind of bored over this weekend, and I decided that it would be a good exercise to write a Caesar Cipher. Here is my code:

class CaesarCipher
{
    private string Sentence;
    private int EncryptShift;
    private int DecryptShift;
    private bool IsEncrypted = false;

    public CaesarCipher(string input, int shifting)
    {
        Sentence = input.ToLower();
        EncryptShift = shifting;
        DecryptShift = -shifting;
    }

    public string Encrypt()
    {
        if (IsEncrypted)
            return Sentence;

        char[] char_array = Sentence.ToCharArray();

        Shuffle(char_array, EncryptShift);

        Recunstruct(char_array);

        return Sentence;
    }

    public string Decrypt()
    {
        if (!IsEncrypted)
            return Sentence;

        char[] char_array = Sentence.ToCharArray();

        Shuffle(char_array, DecryptShift);

        Recunstruct(char_array);

        return Sentence;
    }

    private void Shuffle(char[] char_array, int shift)
    {
        for (int index = 0; index < char_array.Length; index++)
        {
            char letter = char_array[index];

            if (letter >= 'a' && letter <= 'z')
            {
                letter = (char)(letter + shift);

                if (letter > 'z')
                    letter = (char)(letter - 26);

                else if (letter < 'a')
                    letter = (char)(letter + 26);
            }

            char_array[index] = letter;
        }
    }

    private void Recunstruct(char[] char_array)
    {
        Sentence = null;

        foreach (char letter in char_array)
            Sentence += letter;

        IsEncrypted = true;
    }
}

That's all for now, thanks for reading!

Wednesday, May 4, 2016

Max & Min Heap

So now that class is over and I took my final for my CS2420 class last night, I find that I have come to love programming and I miss not having an assignment to work on. So today I decided that since I had already created a Max Heap class, that I should also create a Min Heap class.

While I was working, I found that 99% of the code was going to be the same, and I didn't want to just create a copy and tweak a few lines. So instead I decided to create a abstract Heap class that I could inherit from.

So I created the base class and moved most of the code to that file. Then I made the Max and Min Heap classes and made the changes required in each class to make it work. While this also wasn't that hard, I think that it was a good exerciser. I did something similar in the Components assignment, but I think this was a much better example of how to use inheritance.

Here is my code:


That's all for now, thanks for reading!