定價: | ||||
售價: | 1600元 | |||
庫存: | 已售完 | |||
LINE US! | ||||
此書為本公司代理,目前已售完,有需要可以向line客服詢問進口動向 | ||||
付款方式: | 超商取貨付款 |
![]() |
|
信用卡 |
![]() |
||
線上轉帳 |
![]() |
||
物流方式: | 超商取貨 | ||
宅配 | |||
門市自取 |
為您推薦
類似書籍推薦給您
類似書籍推薦給您
【簡介】 『技術債在每個程式倉庫(codebase)中幾乎無所不在。它是一種隱喻,代表著軟體演變過程中留下的小小麻煩(有時並不那麼小),例如捷徑、混亂、設計不相符等問題,這些問題往往是由於軟體無法適應不斷變化的外部因素所造成的。如果不加以控制,這些問題就會導致工作效率急遽下降,而重構(refactoring)正是開發者處理這個問題的主要工具。這是每位開發者都應該掌握的重要技能。』 ——NimblePros首席架構師 Steve "ardalis" Smith 『這是一本.NET資淺到資深開發者都能受益的書。程式開發沒有人不需要重構,而重構未必需要很多高深的理論才能做,只要你學好本書的精髓,沒有Visual Studio一樣可以重構,只是有工具的幫忙可以發揮加分效果,這是我在審校本書時很深的體悟。』 ——微軟最有價值專家(Microsoft MVP) 陳傳興(Bruce Chen) 重構:改善.NET與C#應用程式的設計,償還欠下的技術債 Refactoring with C# 使用GitHub Copilot與Visual Studio 每個軟體專案剛開始時都是一塊全新的綠地(greenfield)樂園,但技術債(technical debt)往往比預期更早出現,軟體專案很快就會變成一片棕地(brownfield)荒野,徒留滿地遺留程式碼(legacy code)和技術債。在本書中,你將了解技術債的概念與成因,並學習使用Visual Studio的現代化工具,以及C# 12和.NET 8的最新語言功能,以此安全地重構你的C#程式碼。 我們將一步步指引你學會使用xUnit和Moq、Snapper、Scientist .NET等函式庫,使用這些工具,你就能執行更進階的單元測試,安全地進行重構。我們也會詳述SOLID原則,以及新版C#帶來的防禦性程式設計技巧,藉此打造更容易維護的程式碼。我們還會說明如何執行程式碼分析,並撰寫自訂的Roslyn分析器,來檢測和解決程式碼中獨有的問題。 程式設計的性質正在發生變化,為了迎接AI帶來的衝擊,本書「第11章」會專門討論GitHub Copilot Chat這個AI助理,看看它如何協助我們進行重構、測試、撰寫文件和產生程式碼。最後,我們也會討論如何在敏捷團隊和企業組織中,向領導者們溝通技術債的風險與重構的必要性,並獲得組織的支持與尊重。 讀完本書,你將理解重構的本質,了解如何安全、有效、可重複地償還應用程式中的技術債,同時為企業帶來價值。無論你是新手開發者,還是有多年經驗的資深開發者,相信你們都能在本書中找到一些實用的提示和技術。 ★學習目標★ ・理解技術債的成因、影響及預防方法 ・探索重構類別、方法和單行程式碼的不同做法 ・如何使用Moq等函式庫撰寫有效的單元測試 ・理解SOLID原則,以及如何打造可維護的程式碼 ・GitHub Copilot Chat如何協助開發者分析、改善和測試程式碼 ・應用程式碼分析和自訂Roslyn分析工具,確保程式碼保持整潔 ・在敏捷團隊中正面表達技術債的風險,並採用一致的程式碼標準 【範例程式碼】 讀者可以從GitHub下載本書的範例程式碼,如果程式碼有更新,作者也會直接更新在存放庫上:https://github.com/PacktPublishing/Refactoring-with-CSharp。 【彩色圖片】 博碩文化官網也有提供本書使用的螢幕畫面截圖及彩色圖表。 【目錄】 審校序 推薦序 貢獻者 前言 Part 1:在Visual Studio中使用C#進行重構 第1章:技術債、程式碼異味與重構 1.1 理解技術債和遺留程式碼 1.2 識別程式碼異味 1.3 介紹重構 1.4 案例研究:雲霄航空公司 1.5 小結 1.6 問題 1.7 延伸閱讀 第2章:重構簡介 2.1 技術需求 2.2 重構行李費用計算器 2.3 在其他編輯器中的重構 2.4 小結 2.5 問題 2.6 延伸閱讀 第3章:重構程式碼流程和迭代 3.1 技術需求 3.2 重構登機應用程式 3.3 控制程式流程 3.4 執行個體化物件 3.5 迭代集合 3.6 重構LINQ陳述式 3.7 檢查並測試我們重構後的程式碼 3.8 小結 3.9 問題 3.10 延伸閱讀 第4章:在方法層級的重構 4.1 技術需求 4.2 重構航班追蹤器 4.3 重構方法 4.4 重構建構函式 4.5 重構參數 4.6 重構為函式 4.7 介紹靜態方法和擴充方法 4.8 檢查並測試我們重構後的程式碼 4.9 小結 4.10 問題 4.11 延伸閱讀 第5章:物件導向重構 5.1 技術需求 5.2 重構航班搜尋系統 5.3 透過重構來組織類別 5.4 重構與繼承 5.5 使用抽象控制繼承 5.6 為更好的封裝進行重構 5.7 透過介面和多型來改善類別 5.8 檢查並測試我們重構後的程式碼 5.9 小結 5.10 問題 5.11 延伸閱讀 Part 2:安全地重構 第6章:單元測試 6.1 技術需求 6.2 理解測試和單元測試 6.3 使用xUnit測試程式碼 6.4 重構單元測試 6.5 探索其他測試框架 6.6 採取測試心態 6.7 小結 6.8 問題 6.9 延伸閱讀 第7章:測試驅動開發(TDD) 7.1 技術需求 7.2 什麼是TDD? 7.3 使用Visual Studio的TDD 7.4 何時使用TDD? 7.5 小結 7.6 問題 7.7 延伸閱讀 第8章:使用SOLID避免程式碼反模式 8.1 識別C#程式碼中的反模式 8.2 撰寫SOLID程式碼 8.3 考慮其他的架構原則 8.4 小結 8.5 問題 8.6 延伸閱讀 第9章:進階單元測試 9.1 技術需求 9.2 使用Shouldly建立易讀的測試 9.3 使用Bogus產生測試資料 9.4 使用Moq與NSubstitute模擬依賴關係 9.5 使用Snapper固定測試 9.6 使用Scientist .NET進行實驗 9.7 小結 9.8 問題 9.9 延伸閱讀 第10章:防禦性程式設計技巧 10.1 技術需求 10.2 介紹雲霄API 10.3 驗證輸入內容 10.4 防止null值 10.5 超越類別 10.6 進階型別使用 10.7 小結 10.8 問題 10.9 延伸閱讀 Part 3:利用AI和程式碼分析進階重構 第11章:AI輔助重構:使用GitHub Copilot 11.1 技術需求 11.2 介紹GitHub Copilot 11.3 在Visual Studio中開始使用GitHub Copilot 11.4 使用GitHub Copilot Chat進行重構 11.5 使用GitHub Copilot Chat撰寫文件 11.6 使用GitHub Copilot Chat產生Test Stub 11.7 理解GitHub Copilot的限制 11.8 案例研究:雲霄航空公司 11.9 小結 11.10 問題 11.11 延伸閱讀 第12章:Visual Studio中的程式碼分析 12.1 技術需求 12.2 在Visual Studio中計算程式碼度量 12.3 在Visual Studio中進行程式碼分析 12.4 探索進階的程式碼分析工具 12.5 案例研究:雲霄航空公司 12.6 小結 12.7 問題 12.8 延伸閱讀 第13章:建立一個Roslyn分析器 13.1 技術需求 13.2 理解Roslyn分析器 13.3 建立一個Roslyn分析器 13.4 使用RoslynTestKit測試Roslyn分析器 13.5 將分析器分享為Visual Studio擴充功能 13.6 小結 13.7 問題 13.8 延伸閱讀 第14章:使用Roslyn分析器重構程式碼 14.1 技術需求 14.2 案例研究:雲霄航空公司 14.3 建立一個Roslyn分析器程式碼修正 14.4 使用RoslynTestKit測試程式碼修正 14.5 將Roslyn分析器發佈為NuGet套件 14.6 小結 14.7 問題 14.8 延伸閱讀 Part 4:企業中的重構 第15章:溝通技術債 15.1 克服重構的障礙 15.2 溝通技術債 15.3 優先處理技術債 15.4 獲得組織的認同 15.5 案例研究:雲霄航空公司 15.6 小結 15.7 問題 15.8 延伸閱讀 第16章:採用程式碼標準 16.1 技術需求 16.2 理解程式碼標準 16.3 建立程式碼標準 16.4 在Visual Studio中進行格式化和程式碼清除 16.5 使用EditorConfig套用程式碼標準 16.6 小結 16.7 問題 16.8 延伸閱讀 第17章:敏捷重構 17.1 在敏捷環境中的重構 17.2 成功應用敏捷重構策略 17.3 完成大規模重構 17.4 重構出錯時的復原方式 17.5 部署大規模重構 17.6 案例研究:雲霄航空公司 17.7 小結 17.8 打造更永續的軟體 17.9 問題 17.10 延伸閱讀
類似書籍推薦給您
As industrialized nations look into emerging new technologies focusing on renewable or efficient energy use — along with the move towards Sustainable Development Goals — challenges related to achieving low carbon economy projects have gained much attention. This book explores various initiatives and potential methods to achieve net-zero carbon targets and issues. Life Cycle Assessment (LCA) will play an important role as an effective and comprehensive method to analyze potential greenhouse gas emissions and other environmental impacts of a technology or system. LCA is a holistic and system-wide scientific method that can be used to quantify impact metrics chosen to evaluate any emerging Net-Zero Carbon technologies of interest, and reveal environmental trade-offs or further research opportunities that are required for balancing CO2 emissions. LCA perspectives of Net-Zero Carbon Technologies can also be used to outline decision-making strategies for a nation's shift towards low carbon economic development. Sample Chapter(s) Preface Chapter 1: Trends of Emerging Zero-Carbon Technologies: The Role of the Life Cycle Assessment for Evaluating Carbon Dioxide Reduction Targets Contents: Trends of Emerging Zero-Carbon Technologies: The Role of the Life Cycle Assessment for Evaluating Carbon Dioxide Reduction Targets (Hsien Hui KHOO and Reginald B.H. TAN) From Carbon Dioxide to Renewable Fuels and Chemicals: The Important Role of Catalysis (Pin LIM, CHANG Jie, CHEN Luwei, POH Chee Kok, LIM San Hua and Hsien Hui KHOO) Life Cycle Costing and Carbon Dioxide Emissions of Hydrogen Supply Chains using Different Energy Carriers: A Case Study of Japan for 2030 () Connection of the Methanol Economy to Net-Zero Emissions Supported by LCA-Based Environmental Performance Information (Róbert MAGDA, Judit TÓTH and Sarolta IGAZ) Life Cycle Assessment of Different Solar to Hydrogen Routes and Hydrogen Carriers (Zhihua WANG, Jinxu ZHANG and Runfan ZHU) Hydrogen Production from Biomass and Waste: Life Cycle Assessment Perspective and Deployment Opportunities (Massimiliano MATERAZZI, Andrea PAULILLO and Paola LETTIERI) Life Cycle Assessment of Chemical Recycling: Recommendations for a Systemic Assessment of its Contribution to the Circular Carbon Economy and Zero Waste Transition (Roh Pin LEE, Florian KELLER and Raoul VOSS) Evaluation of Recycling Methods: Towards Decarbonization of Chemicals and Fuels via a Circular Economy Model (TAY Siok Wei, Warintorn THITSARTARN and Hsien Hui KHOO) Feasibility Review of Hydrogen Production Options: Life Cycle Assessment and Economic Assessment (Pancy ANG and Hsien Hui KHOO) Life Cycle Assessment Digitalization to Assess the Performance of Linear Infrastructure Projects (Koji NEGISHI) Biodiesel Production from Palm Oil Feedstock: Techno-Economic Assessment and Life Cycle Assessment Applications (Iskandar HALIM and Hsien Hui KHOO) Progress on Carbon Balancing in Life Cycle Assessment with a Focus on the Ecosystem Service Contribution (Benedetto RUGANI and Marco ALLOCCO) Multi-Criteria Decision-Making Framework for Sustainability Assessment (Dhanush MAJJI and Arnab DUTTA) Environmental and Economic Impacts of Food Waste Management — A Focus on Sustainability and Life Cycle Assessment (Matthew FRANCHETTI, Alex SPIVAK, Shrijith Ashok KUMAR and Lakshika KURUPPUARACHCHI) The Net-Zero Carbon Dioxide Framework for Life Cycle Assessment of Carbon Dioxide Capture, Utilization and Storage Techniques (Arezoo AZIMI, Li SHEN and Mijndert VAN DER SPEK) Power Plant Integrated with Carbon Capture and Utilization: Potential Carbon-based Fuels and Chemicals in Singapore (S C Lenny KOH, Hsien Hui KHOO and Moein SHAMOUSHAKI) Readership: Life Cycle Analysis Practitioners, Environmental Researchers/Scientists, and Professors.