Amazon profit crushes estimates as cloud-service revenue soars

Amazon.com Inc (AMZN.O) on Thursday reported profit and revenue that blew past analysts' expectations, sending its shares soaring in after-hours trading and demonstrating the growing market power of its core retail business and new cloud services division.The results draw a sharp contrast to the disappointing fourth quarter Amazon reported in January, which renewed worries among some shareholders about the company's comparatively thin profit margins. Shares of the world's biggest online retailer jumped nearly 13 percent to $679 in extended trading on Thursday.Amazon's performance also assuaged concerns about a broader slowdown among tech and internet companies after Apple (AAPL.O), Microsoft (MSFT.O) and Intel (INTC.O) all reported disappointing earnings."It did restore my faith," said Dan Conde, an analyst at the Enterprise Strategy Group, who keeps a close eye on Amazon's cloud business. The company also offered a bright outlook, with revenue guidance for the current quarter of $28 billion to $30.5 billion, compared to the $28.33 billion analysts had expected.While Amazon displayed impressive growth for a company its size - revenues last quarter rose 28.2 percent to $29.13 billion, the biggest revenue growth since 2012 - its Amazon Web Services (AWS) cloud computing division was the highlight. Revenues at the division climbed 64 percent to $2.56 billion while operating income more than tripled to $604 million.Even though operating margins fell at the unit compared to last quarter, as Amazon spends heavily to compete with rivals like Microsoft and Google (GOOGL.O), they remain a healthy 27.9 percent. That compares to 28.5 percent last quarter, and 16.9 percent a year earlier. AWS, launched 10 years ago, delivered more profit in the quarter than Amazon's retail business. Research firms say AWS has more than 30 percent of the fast-growing cloud-computing market and it remains far ahead of rivals including Microsoft and Google.Amazon said it also has seen strong growth in subscribers to its Prime loyalty program, which offers one-hour delivery, original TV programming and access to its digital entertainment products such as Prime Music and Prime Video for an annual fee of $99. The company said it would ramp up spending to entice Prime customers through video content, particularly its "Prime Originals" - shows Amazon develops itself. That strategy builds on the success of programs including "Mozart in the Jungle" and "Transparent," which each have won Golden Globe awards."We feel that program is working," Chief Financial Officer Brian Olsavsky said in a conference call with analysts. "We're going to significantly increase our spend in that area." The company recently launched a monthly subscription to the program for $10.99. Amazon has also said it plans to offer its video streaming service as a standalone service for a monthly fee of $8.99. Amazon does not break out the numbers of Prime subscribers, but Consumer Intelligence Research Partners says the program has 54 million U.S. members. Amazon's growth on the revenue side suggests that the relationship model around Amazon Prime is working, said Frank Gillett, a senior analyst at Forrester Research.Amazon on Thursday also said it would continue to build its logistics operations, where it has started using its own trucks and planes to supplement carriers such as UPS and Fedex and offer-same day service. "They're still great partners, have been, and will continue to be for the future," Olsavsky said in response to an analyst who asked if Amazon would ever entertain delivering items for those companies. "But we see opportunities where we need to add additional capacity and we're filling those voids." Amazon founder Jeff Bezos also touted the success of new hardware products. "Amazon devices are the top selling products on Amazon," he said in a press release, citing the Echo voice-response system and the Fire TV Stick.The Echo has been a surprise hit and Bezos said in the statement that the company could not keep it in stock, but he declined to provide sales figures.Amazon's net sales in North America, its biggest market by revenue, increased 26.8 percent to $17 billion in the first quarter.Amazon reported net income of $513 million, or $1.07 per share, for the quarter ended March 31, marking a fourth straight quarter of profits for the once perennially money-losing company. A year earlier, Amazon reported a loss of $57 million, or 12 cents per share.Analysts on average had expected a profit of 58 cents per share and revenue of $27.98 billion, according to Thomson Reuters I/B/E/S. (Reporting by Narottam Medhora in Bengaluru and Sarah McBride in San Francisco; Editing by Kirti Pandey, Jonathan Weber and Bernard Orr)

Read more

Amazon profit crushes estimates as cloud service revenue jumps

Amazon.com Inc's (AMZN.O) quarterly profit and revenue topped analysts' expectations by a wide margin as the Prime loyalty program helped the online retail giant attract more customers and revenue surged in its cloud services business. Shares of the world's biggest online retailer jumped nearly 13 percent to $679 in extended trading on Thursday.Amazon has seen strong growth in subscribers to its Prime loyalty program, which offers one-hour delivery, original TV programming and access to its digital entertainment products such as Prime Music and Prime Video for an annual fee of $99. The company recently launched a monthly subscription to the program for $10.99. Amazon has also said it plans to offer its video streaming service for a monthly fee of $8.99. Amazon's net sales in North America, its biggest market by revenue, increased 26.8 percent to $17 billion in the first quarter. Revenue from its cloud services business, Amazon Web Services, surged 63.9 percent to $2.57 billion. The unit, Amazon's fastest growing business, is seen as the next driver of growth for the company. Amazon reported net income of $513 million, or $1.07 per share, for the quarter ended March 31. The company had a loss of $57 million, or 12 cents per share, a year earlier.Net sales surged 28.2 percent to $29.13 billion. Analysts on average had expected a profit of 58 cents per share and revenue of $27.98 billion, according to Thomson Reuters I/B/E/S. (Reporting by Narottam Medhora in Bengaluru; Editing by Kirti Pandey)

Read more

Glitch postpones first space flight from Russia's new launch-pad

MOSCOW A technical fault forced Russia's space agency on Wednesday to postpone at the last minute the inaugural launch of a rocket into space from its new Vostochny launch-pad, Russian media reported.An unmanned Soyuz rocket carrying three satellites had been scheduled to fire off into orbit from the Vostochny site, which was built to end Russia's reliance on the Baikonur cosmodrome in neighboring Kazakhstan. Moments before the scheduled launch time, officials at the launch-site, in Russia's far eastern Amur region, announced a postponement until Thursday morning, citing technical problems, Interfax news agency reported. (Reporting by Christian Lowe; Editing by Robert Birsel)

Read more

How to Write Unmaintainable Code

A little over ten years ago, I came across a gem of an essay, called, "Unmaintainable Code".A tongue-in-cheek look at what are essentially anti-patterns, or, "what not to do", the essay is full of great insight as well as non-stop laughs.  The essay is meant for developers of all skill levels; however, the more years you have in the industry, the more of the points made will ring true as well as be even funnier.(Courtesy: frinkiac.com)Included in the essay are examples of the anti-patterns themselves which really help drive the author's point home.Still not convinced?  To give you a sense of what the essay has in store, here are a couple of excerpts from my favorite section:"Testing is for Cowards"A brave coder will bypass that step. Too many programmers are afraid of their boss, afraid of losing their job, afraid of customer hate mail and afraid of being sued. This fear paralyzes action and reduces productivity. Studies have shown that eliminating the test phase means that managers can set ship dates well in advance, an obvious aid in the planning process. With fear gone, innovation and experimentation can blossom. The role of the programmer is to produce code and debugging can be done by a cooperative effort on the part of the help desk and the legacy maintenance group.If we have full confidence in our coding ability, then testing will be unnecessary. If we look at this logically, then any fool can recognise that testing does not even attempt to solve a technical problem, rather, this is a problem of emotional confidence. A more efficient solution to this lack of confidence issue is to eliminate testing completely and send our programmers to self-esteem courses. After all, if we choose to do testing, then we have to test every program change, but we only need to send the programmers to one course on building self-esteem. The cost benefit is as amazing as it is obvious."If you can make it all the way through that passage without both recognizing someone who is guilty of the sin mentioned as well as not falling out of your chair laughing, you are a better person than I am.Here is another excellent excerpt with an example to help underscore this particular anti-pattern:"Accented Letters"Use accented characters on variable names, e. g.:typedef struct { int i; } ínt;Where the second ínt’s í is actually i-acute. With only a simple text editor, it’s nearly impossible to distinguish the slant of the accent mark."I wholly encourage any and all developers to read through the entire piece.  Yes, it is a bit of a long read, but it is most definitely worth your time.  After all, we could all use a refresher in what not to do, and what to look for, so why not have a laugh or two while (not?) doing it?

Read more

Null Object Design Pattern in Automated Testing

If you are a  regular reader of Automate The Planet you have most probably read some of my articles about Design Patterns in Automated Testing. The newest article from the famous series is dedicated to the Null Object Design Pattern. I am going to explain how to use the pattern to create a default behavior for your strategies and achieve cleaner and more concise test code. Less branching in the code means lower complexity.In object-oriented computer programming, a Null Object is an object with no referenced value or with defined neutral ("null") behavior. The Null Object Design Pattern describes the uses of such objects and their behavior (or lack thereof).Rid program logic of null checks where possibleProvide a non-functional object in place of a null referenceAllow methods to be called on Null objects, unlike a null referenceUML Class Diagram ParticipantsThe classes and objects participating in the Null Object Design Pattern are:IPurchasePromotionalCodeStrategy - Defines the interface for all strategies.UiPurchasePromotionalCodeStrategy - The strategy that is responsible for applying and asserting promotional codes through the UI of the application.NullPurchasePromotionalCodeStrategy - The null implementation of the strategy interface, provides the default implementation when no promotional code is applied.Null Object Design Pattern C# CodeTest CaseAs in most of the examples from the series, we are going to automate a shopping cart process, the Amazon one in particular. I am not going to explain the whole process; you can check the full explanations in my articles dedicated to the Strategy Design Pattern. The page that is interesting for us is the last page from the purchase process: Place Order Page. There you can apply promotional codes and gift cards.The main idea is that sometimes we need to add promotional codes and then assert that the correct amounts are displayed or saved in the DB. As you can assume, there are various ways to accomplish that. One way is to use the UI directly and assert the text is present in the labels. Another way is to use a direct access to the DB and insert the promotional code, then assert the calculated entries saved in some of the DB's tables. Also, you can achieve the same thing using a web service. I think you get the point—there are multiple solutions to the problem. In order to be able to understand fully the explanations below, I assume that you have read about the Strategy Design Pattern. If you haven't, I suggest you do so. I think that one of the best solutions for the previously stated problem is to use the strategy design pattern.   The context holds a dependency to IStrategy and wraps the calls to the concrete strategies. In our case, the purchasing workflow is placed in the PurchaseContext class. We call the PurchaseItem method to perform a purchase. The PurchaseContext has a dependency on IPurchasePromotionalCodeStrategy. So depending on what we want to test, we can use the UI to apply and assert the promotional codes or use a direct DB access for a faster test execution.IPurchasePromotionalCodeStrategy InterfaceThe interface contains only three methods. One that applies the code, one that asserts the code, and the last one that gets the discount amount.PurchaseContext Implementation Without Null Object Design PatternThis is how looks the PurchaseContext code if we don't use the Null Object Design Pattern:public class PurchaseContextNoNullObjects { private readonly IPurchasePromotionalCodeStrategy purchasePromotionalCodeStrategy; private readonly ItemPage itemPage; private readonly PreviewShoppingCartPage previewShoppingCartPage; private readonly SignInPage signInPage; private readonly ShippingAddressPage shippingAddressPage; private readonly ShippingPaymentPage shippingPaymentPage; private readonly PlaceOrderPage placeOrderPage; public PurchaseContextNoNullObjects( IPurchasePromotionalCodeStrategy purchasePromotionalCodeStrategy, ItemPage itemPage, PreviewShoppingCartPage previewShoppingCartPage, SignInPage signInPage, ShippingAddressPage shippingAddressPage, ShippingPaymentPage shippingPaymentPage, PlaceOrderPage placeOrderPage) { this.purchasePromotionalCodeStrategy = purchasePromotionalCodeStrategy; this.itemPage = itemPage; this.previewShoppingCartPage = previewShoppingCartPage; this.signInPage = signInPage; this.shippingAddressPage = shippingAddressPage; this.shippingPaymentPage = shippingPaymentPage; this.placeOrderPage = placeOrderPage; } public void PurchaseItem( string itemUrl, string itemPrice, ClientLoginInfo clientLoginInfo, ClientPurchaseInfo clientPurchaseInfo) { this.itemPage.Navigate(itemUrl); this.itemPage.ClickBuyNowButton(); this.previewShoppingCartPage.ClickProceedToCheckoutButton(); this.signInPage.Login(clientLoginInfo.Email, clientLoginInfo.Password); this.shippingAddressPage.FillShippingInfo(clientPurchaseInfo); this.shippingAddressPage.ClickDifferentBillingCheckBox(clientPurchaseInfo); this.shippingAddressPage.ClickContinueButton(); this.shippingPaymentPage.ClickBottomContinueButton(); this.shippingAddressPage.FillBillingInfo(clientPurchaseInfo); this.shippingAddressPage.ClickContinueButton(); this.shippingPaymentPage.ClickTopContinueButton(); double couponDiscount = 0; if (purchasePromotionalCodeStrategy != null) { this.purchasePromotionalCodeStrategy.AssertPromotionalCodeDiscount(); couponDiscount = this.purchasePromotionalCodeStrategy.GetPromotionalCodeDiscountAmount(); } double totalPrice = double.Parse(itemPrice); this.placeOrderPage.AssertOrderTotalPrice(totalPrice, couponDiscount); // Some other actions... if (purchasePromotionalCodeStrategy != null) { this.purchasePromotionalCodeStrategy.AssertPromotionalCodeDiscount(); } } }As I already have mentioned, in the body of the PurchaseItem method you can find the order's completion workflow. Though a constructor injection, we pass all dependencies of the PurchaseContext, such as all required pages and the concrete implementation of the IPurchasePromotionalCodeStrategy. However, there might be cases where we don't need to apply promotional codes and the strategy might not be initialized. Because of that we use null checks. If we don't use them a NullReferenceException might be thrown. UI Implementation of IPurchasePromotionalCodeStrategyThis is how the UI implementation of the IPurchasePromotionalCodeStrategy interface looks.public class UiPurchasePromotionalCodeStrategy : IPurchasePromotionalCodeStrategy { private readonly PlaceOrderPage placeOrderPage; private readonly double couponDiscountAmount; public UiPurchasePromotionalCodeStrategy( PlaceOrderPage placeOrderPage, double couponDiscountAmount) { this.placeOrderPage = placeOrderPage; this.couponDiscountAmount = couponDiscountAmount; } public void AssertPromotionalCodeDiscount() { Assert.AreEqual( this.couponDiscountAmount.ToString(), this.placeOrderPage.PromotionalDiscountPrice.Text); } public double GetPromotionalCodeDiscountAmount() { return this.couponDiscountAmount; } public void ApplyPromotionalCode(string couponCode) { this.placeOrderPage.PromotionalCode.SendKeys(couponCode); } }This concrete implementation of IPurchasePromotionalCodeStrategy is dependent to the PlaceOrderPage. We use the UI to apply and assert the promotional codes.Null Object Implementation of IPurchasePromotionalCodeStrategyThe default implementation of the promotional codes' interface is pretty simple.public class NullPurchasePromotionalCodeStrategy : IPurchasePromotionalCodeStrategy { public void AssertPromotionalCodeDiscount() { } public double GetPromotionalCodeDiscountAmount() { return 0; } public void ApplyPromotionalCode(string couponCode) { } }We return zero for the discount amount and the body of the rest of the methods is empty.PurchaseContext Implementation With Null Object Design Patternpublic class PurchaseContext { private readonly IPurchasePromotionalCodeStrategy purchasePromotionalCodeStrategy; private readonly ItemPage itemPage; private readonly PreviewShoppingCartPage previewShoppingCartPage; private readonly SignInPage signInPage; private readonly ShippingAddressPage shippingAddressPage; private readonly ShippingPaymentPage shippingPaymentPage; private readonly PlaceOrderPage placeOrderPage; public PurchaseContext( IPurchasePromotionalCodeStrategy purchasePromotionalCodeStrategy, ItemPage itemPage, PreviewShoppingCartPage previewShoppingCartPage, SignInPage signInPage, ShippingAddressPage shippingAddressPage, ShippingPaymentPage shippingPaymentPage, PlaceOrderPage placeOrderPage) { this.purchasePromotionalCodeStrategy = purchasePromotionalCodeStrategy; this.itemPage = itemPage; this.previewShoppingCartPage = previewShoppingCartPage; this.signInPage = signInPage; this.shippingAddressPage = shippingAddressPage; this.shippingPaymentPage = shippingPaymentPage; this.placeOrderPage = placeOrderPage; } public void PurchaseItem( string itemUrl, string itemPrice, ClientLoginInfo clientLoginInfo, ClientPurchaseInfo clientPurchaseInfo) { this.itemPage.Navigate(itemUrl); this.itemPage.ClickBuyNowButton(); this.previewShoppingCartPage.ClickProceedToCheckoutButton(); this.signInPage.Login(clientLoginInfo.Email, clientLoginInfo.Password); this.shippingAddressPage.FillShippingInfo(clientPurchaseInfo); this.shippingAddressPage.ClickDifferentBillingCheckBox(clientPurchaseInfo); this.shippingAddressPage.ClickContinueButton(); this.shippingPaymentPage.ClickBottomContinueButton(); this.shippingAddressPage.FillBillingInfo(clientPurchaseInfo); this.shippingAddressPage.ClickContinueButton(); this.shippingPaymentPage.ClickTopContinueButton(); this.purchasePromotionalCodeStrategy.AssertPromotionalCodeDiscount(); var couponDiscount = this.purchasePromotionalCodeStrategy.GetPromotionalCodeDiscountAmount(); double totalPrice = double.Parse(itemPrice); this.placeOrderPage.AssertOrderTotalPrice(totalPrice, couponDiscount); this.purchasePromotionalCodeStrategy.AssertPromotionalCodeDiscount(); } }As you have most probably noticed the code is almost identical to the previous implementation with the small difference that the null checks are missing.Null Object Design Pattern is about giving a default implementation for filling the absence of an object and it is not about avoiding null reference exceptions. If you see Null Object Design Pattern implemented with no object collaboration then there is something wrong in the way the pattern is implemented.Null Object Design Pattern in Tests[TestClass] public class AmazonPurchaseNullObjectTests { [TestInitialize] public void SetupTest() { Driver.StartBrowser(); } [TestCleanup] public void TeardownTest() { Driver.StopBrowser(); } [TestMethod] public void Purchase_SeleniumTestingToolsCookbook() { string itemUrl = "/Selenium-Testing-Cookbook-Gundecha-Unmesh/dp/1849515743"; string itemPrice = "40.49"; ClientPurchaseInfo clientPurchaseInfo = new ClientPurchaseInfo( new ClientAddressInfo() { FullName = "John Smith", Country = "United States", Address1 = "950 Avenue of the Americas", State = "New York", City = "New York City", Zip = "10001-2121", Phone = "00164644885569" }); clientPurchaseInfo.CouponCode = "99PERDIS"; ClientLoginInfo clientLoginInfo = new ClientLoginInfo() { Email = "g3984159@trbvm.com", Password = "ASDFG_12345" }; var purchaseContext = new PurchaseContext( new NullPurchasePromotionalCodeStrategy(), new ItemPage(Driver.Browser), new PreviewShoppingCartPage(Driver.Browser), new SignInPage(Driver.Browser), new ShippingAddressPage(Driver.Browser), new ShippingPaymentPage(Driver.Browser), new PlaceOrderPage(Driver.Browser)); ////var purchaseContext = new PurchaseContext( ////new UiPurchasePromotionalCodeStrategy( ////new PlaceOrderPage(Driver.Browser), 20), //// new ItemPage(Driver.Browser), //// new PreviewShoppingCartPage(Driver.Browser), //// new SignInPage(Driver.Browser), //// new ShippingAddressPage(Driver.Browser), //// new ShippingPaymentPage(Driver.Browser), //// new PlaceOrderPage(Driver.Browser)); purchaseContext.PurchaseItem( itemUrl, itemPrice, clientLoginInfo, clientPurchaseInfo); } }The usage of the promotional code's strategies in tests is straightforward. If you want to apply a promotional code, you should use the UiPurchasePromotionalCodeStrategy, or if you don't, use NullPurchasePromotionalCodeStrategy (where the default do-nothing behavior is wrapped). In the next part of the series I am going to show you how to utilize the Null Object Design Pattern to the maximum extent through the Singleton Design Pattern and Unity IOC Container.

Read more
Older Post